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 C++ (GCC 9.2.1) (judge verdict: Wrong Answer)

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

/*********************************************
 * 素因数分解
 *********************************************/

/*
 * 計算クラス
 */
class Calc
{
    // 宣言
    int a;

    public:
        // 素因数分解
        void decompositPrime(ll a);
};

/*
 * 素因数分解
 */
void Calc::decompositPrime(ll n)
{
    vector<ll> p(1000);
    vector<ll> p2(1000);
    ll cnt = 0;
    ll judge1 = 0;
    ll ans = 0;
    ll secondtolast = 0;

    // 割る数の初期値
    a = 2;
    // √n ≧ a ( n ≧ a * a ) の間ループ処理
    while (n >= a * a) {
        // a で割り切れたら、a は素因数
        // そして、割られる数を a で割る
        // a で割り切れなかったら、 a を 1 増加させる
        if (n % a == 0) {
            judge1 = 1;
            //printf("%d * ", a);
            n /= a;
            p[cnt]++;
            secondtolast = a;
        } else {
            a++;
            if(judge1==1){
                cnt++;
                judge1 = 0;
            }
        }
    }
    // 最後に残った n は素因数
    //printf("%lld\n", n);
    if(secondtolast==n){
        p[cnt]++;
    }else if(n!=1){
        p[cnt+1]++;
    }
    /*rep(i,1000){
        cout<<p[i]<<" ";
    }*/
    rep(i,1000){
        int tmp = 1;
        int cnt2 = 0;
        for(;;){
            if(p[i]>=tmp){
                tmp += pow(2,cnt2+1);
                cnt2++;
            }else{
                break;
            }
        }
        p2[i] = cnt2;
    }
    rep(i,1000){
        ans += p2[i];
    }
    /*rep(i,1000){
        cout<<p2[i]<<" ";
    }*/
    cout<<ans<<endl;
}

/*
 * メイン処理
 */
int main()
{
    ll  iNum;

    try
    {
        // 計算クラスインスタンス化
        Calc objCalc;

        while (1) {
            // 自然数入力
            //cout << "自然数 ( 0 : 終了 )：";
            cin  >> iNum;
            if (cin.fail()) break;
            if (iNum < 1) break;

            // 素因数分解
            objCalc.decompositPrime(iNum);
        }
    }
    catch (...) {
        cout << "例外発生！" << endl;
        return -1;
    }

    // 正常終了
    return 0;
}