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 proconio::input;

mod Prime {
    struct Generator23 {
        value: i64,
        step: i64,
    }

    impl Generator23 {
        pub fn new() -> Self {
            Generator23 { value: 2, step: 0 }
        }

        pub fn next(&mut self) -> i64 {
            if self.step > 0 {
                self.value += self.step;
                self.step = 6 - self.step;
            } else if self.value == 2 {
                self.value = 3;
            } else if self.value == 3 {
                self.value = 5;
                self.step = 2;
            }
            self.value
        }
    }

    fn is_prime(value: i64) -> bool {
        let gcd = |n, m| {
            let mut n = n;
            let mut m = m;
            while m > 0 {
                let tmp = m;
                m = n % m;
                n = tmp;
            }
            n
        };

        if value <= 3 {
            return value >= 2;
        }
        if value == 5 {
            return true;
        }
        if gcd(value, 30) != 1 {
            return false;
        }
        for p in (7..((value as f64).sqrt() as i64)).step_by(30) {
            if [p, p + 4, p + 6, p + 10, p + 12, p + 16, p + 22, p + 24]
                .into_iter()
                .any(|x| value % x == 0)
            {
                return false;
            }
        }
        return true;
    }

    #[derive(Debug)]
    pub struct Exp {
        pub base: i64,
        pub exp: i64,
    }

    impl Exp {
        pub fn new(base: i64, exp: i64) -> Self {
            Exp { base, exp }
        }
    }

    pub fn prime_division(value: i64) -> Vec<Exp> {
        let mut value = value;
        let mut pf = Vec::new();

        if value == 0 {
            return pf;
        }
        if value < 0 {
            value = -value;
            pf.push(Exp::new(-1, 1));
        }

        let mut generator = Generator23::new();
        let mut p = 2;
        loop {
            let mut count = 0;
            while value % p == 0 {
                value /= p;
                count += 1;
            }
            if count != 0 {
                pf.push(Exp::new(p, count));
            }
            if value <= p {
                break;
            }
            p = generator.next();
        }

        if value > 1 {
            pf.push(Exp::new(value, 1))
        }
        return pf;
    }
}

fn main() {
    input! {
        n: i64,
    }

    let pf = Prime::prime_division(n);
    let ans = pf.into_iter().fold(0, |acc, x| {
        if x.base == 1 {
            acc
        } else {
            let mut x = x.exp;
            let mut count = 1;
            while x >= count {
                x -= count;
                count += 1;
            }
            acc + count - 1
        }
    });

    println!("{}", ans);
}