A calibration routine needs the number of divisors of n that are perfect squares. A positive integer d is a perfect square if d = k * k for some non-negative integer k (so 1, 4, 9, 16, ... are perfect squares). Count the divisors of n that are perfect squares, including 1.
A single line with one integer n.
A single integer: the number of divisors of n that are perfect squares.
Example 1
Input
16
Expected
3
Explanation
The divisors of 16 are 1, 2, 4, 8, 16; of these 1, 4, and 16 are perfect squares, so the answer is 3.
Example 2
Input
12
Expected
2
Explanation
The divisors of 12 are 1, 2, 3, 4, 6, 12; the perfect squares among them are 1 and 4, so the answer is 2.
Ready to solve this?
Sign in to open the editor, run your code against the sample tests, and submit against the full test suite.
Sign in to solve →