Company: L&T Finance
Difficulty: medium
Prime Factors Operations You are given an integer n . In one operation, you can do the following: Pick a number P such that P is prime and n is divisible by P . Assign n = n / P . Find the maximum number of operations you can perform. Input Format The first line contains an integer, n , denoting the initial value of n described in the problem. Output Format The function must return an INTEGER denoting the maximum number of operations you can perform. Constraints 1 ≤ n ≤ 10 9 Examples Input: 5 Output: 1 In the first operation, we can pick P = 5 . Then n becomes 5 / 5 = 1 . We can do no more operations. Input: 1 Output: 0 We cannot do any operations. Input: 4 Output: 2 In the first operation, pick P = 2 . N becomes 4 / 2 = 2 . In the second operation, pick P = 2 . N becomes 2 / 2 = 1 .