Functions
Function-31
Function-32
Function-33
~/algor $ cat problems/funksiya-tub-boluvchilar-soni
Distinct prime factors
Easy
2000 ms
128 MB
29%
Write a function PrimeFactorCount(x) that returns the number of distinct prime divisors of the positive integer $x$.
Example 1: PrimeFactorCount(12) → 2 — $12 = 2 * 2 * 3$, the distinct prime divisors are $2$ and $3$.
Example 2: PrimeFactorCount(1) → 0 — $1$ has no prime divisors.
Write only the function body.
Input
One line with a positive integer $x$ — the argument of the function.
Output
The value returned by the function: an integer.
Note
$1 \le x \le 10^{6}$
Examples
Input #1
12
Output #1
2
Input #2
1
Output #2
0