Problem:
Score : 400 points

Problem Statement

Given is a positive integer N. Consider repeatedly applying the operation below on N:

First, choose a positive integer z satisfying all of the conditions below:

z can be represented as z=p^e, where p is a prime number and e is a positive integer;

z divides N;

z is different from all integers chosen in previous operations.

Then, replace N with N/z.

Find the maximum number of times the operation can be applied.

Constraints

All values in input are integers.

1 \leq N \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N

Output

Print the maximum number of times the operation can be applied.

Sample Input 1

24

Sample Output 1

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=12.)

Choose z=3 (=3^1). (Now we have N=4.)

Choose z=4 (=2^2). (Now we have N=1.)

Sample Input 2

1

Sample Output 2

0

We cannot apply the operation at all.

Sample Input 3

64

Sample Output 3

3

We can apply the operation three times by, for example, making the following choices:

Choose z=2 (=2^1). (Now we have N=32.)

Choose z=4 (=2^2). (Now we have N=8.)

Choose z=8 (=2^3). (Now we have N=1.)

Sample Input 4

1000000007

Sample Output 4

1

We can apply the operation once by, for example, making the following choice:

z=1000000007 (=1000000007^1). (Now we have N=1.)

Sample Input 5

997764507000

Sample Output 5

7

Solution in Rust (1.42.0) (judge verdict: Time Limit Exceeded)

use std::io::*;
use std::str::FromStr;

//https://qiita.com/tubo28/items/e6076e9040da57368845
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn is_prime(x: i64) -> bool {
    let mut is_p = true;
    //2未満は素数でない
    if x < 2 {
        is_p = false;
    //2は素数
    } else if x == 2 {
        is_p = true;
    //2の倍数は素数でない
    } else if x % 2 == 0{
        is_p = false;
    } else {
        //3から(i*i <= x) まで2ずつ増やしながらxを割り切れるか判定、割り切れる値があれば素数でない。
        //(i*i <= x)は√xの範囲と同値 O(√N)
        let mut counter = Some(3);
        while let Some(i) = counter {
            if i*i <= x {
                if x % i == 0 {
                    is_p = false;
                    counter = None;
                }else{
                    counter = Some(i+2);
                }
            } else{
                counter = None;
            }
        }
    }
    is_p
} 

fn gcd (x:i64,y:i64) -> i64 {
    if x == 0 {
        return y;
    }else{
        return gcd(y%x,x);
    }
}

fn main(){
    let mut n:i64 = read();
    let mut a = 2;
    let mut ans = 0;
    let mut used: Vec<i64> = Vec::new();

    if n == 1 {
        println!("0");
        return;
    }
    loop{
        if is_prime(a) {
            let g = gcd(n,a);
            if n % g == 0 && !used.contains(&g) {
                n /= g;
                ans += 1;    
                used.push(g);
            }else{
                let mut i = 2;
                let mut pow = g.pow(i);
                while pow <= n {
                    if n % pow == 0 && !used.contains(&pow){
                        ans += 1;    
                        n /= pow;
                        used.push(pow);
                    }else{
                        i += 1;
                        pow = g.pow(i);
                    }
                }
                a += 1;
            }
            if a > n {
                break;
            }
        }else{
           a += 1;
        }
    }

    println!("{}",ans);

}