A gear-train designer breaks a gear ratio n down into its prime building blocks. She wants the TOTAL number of prime factors of n, counting a repeated prime as many times as it appears (so 12 = 2 x 2 x 3 has 3 prime factors counted this way, not 2).
Given a single integer n, output the count of its prime factors with multiplicity (this is sometimes called the big-Omega function).
Line 1: a single integer n.
A single integer: the total number of prime factors of n, counted with multiplicity.
Example 1
Input
12
Expected
3
Explanation
12 = 2 x 2 x 3, so there are 3 prime factors with multiplicity.
Example 2
Input
17
Expected
1
Explanation
17 is prime, so it has exactly 1 prime factor (itself).
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 →