#include<iostream>
using namespace std;

long long n, sum=0;
int broy_del (long long, bool&);

int main ()
{
    bool m=false;
    cin >> n;
    if (broy_del(n, m)==0 || broy_del(n, m)==1)
        cout << "1";
    else if (m==true)
    {
        for (long long i=broy_del(n, m); i>=0; i-=2)
        {
            sum+=i;
        }
        cout << sum+(broy_del(n, m)-3);
    }
    else if (m==false)
    {
        for (long long i=broy_del(n, m); i>=0; i-=2)
        {
            sum+=i;
        }
        cout << sum;
    }
    cout << endl;
    return 0;
}

int broy_del (long long n, bool &m)
{
    int br1;
    m=false;
    long long br=0;
    for (int i=2; i<=n; i++)
    {
        br1=0;
        while (n%i==0)
        {
            n/=i;
            br++;
            br1++;
        }
        if (br1==2)
            m=true;
    }
    return br;
}
