stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>

#include <ext/pb_ds/tree_policy.hpp>

 

using namespace std;

using namespace __gnu_pbds;

 

#define fi first

#define se second

#define mp make_pair

#define pb push_back

#define fbo find_by_order

#define ook order_of_key

 

typedef long long ll;

typedef pair<ll,ll> ii;

typedef vector<int> vi;

typedef long double ld; 

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

typedef set<int>::iterator sit;

typedef map<int,int>::iterator mit;

typedef vector<int>::iterator vit;



bool cmp(ii a, ii b)

{

	if(a.fi!=b.fi) return a.fi>b.fi;

	else return a.se>b.se;

}



vector<ii> vec;

ll ans[100001];



int main()

{

	ios_base::sync_with_stdio(0); cin.tie(0);

	int n; cin>>n;

	vec.resize(n);

	ll sum = 0;

	for(int i = 0; i < n; i++)

	{

		ll x; cin>>x;

		vec[i].fi=x;vec[i].se=i;

		sum+=x;

	}

	sort(vec.begin(),vec.end(),cmp);

	ll weight = 0;

	for(int i = 0; i < vec.size(); i++)

	{

		ll cnt = vec[i].fi; ll idx = vec[i].se;

		if(i+1<vec.size()&&vec[i+1].fi==vec[i].fi)

		{

			weight++;

			continue;

		}

		if(i==int(vec.size()) - 1)

		{

			ans[idx]+=cnt*(weight+1);

			break;

		}

		int ptr = i + 1;

		int nxtval = vec[ptr].fi;

		int ext = 1;

		while(ptr<n&&vec[ptr].fi==nxtval)

		{

			ext++;

			ptr++;

		}

		ptr--;

		ext--;

		if(vec[ptr].se<idx)

		{

			ans[idx]+=(cnt-(nxtval+1))*(weight+1)+1+weight;

			weight++;

			continue;

		}

		ans[idx]+=(cnt-nxtval)*(weight+1);

		vec[ptr].se=idx;

		i=ptr-1;

		weight+=ext;

		continue;

	}

	for(int i=0;i<n;i++)

	{

		cout<<ans[i]<<'\n';

	}

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<algorithm>

#include<cstring>

#define MN 100005

using namespace std;

int n,a[MN],px[MN];long long ans[MN];

bool cmp(int x,int y){return a[x]==a[y]?x<y:a[x]>a[y];}

int main(){	

	scanf("%d",&n);

	for(int i=1;i<=n;i++)scanf("%d",&a[i]),px[i]=i;sort(px+1,px+n+1,cmp);int now=px[1],sum=0;

	for(int i=1,j=1;i<=n;i=j){

		for(;j<=n;j++)if(a[px[j+1]]!=a[now])break;now=min(now,px[i]),sum+=j-i+1;

		ans[now]+=1ll*(a[px[i]]-a[px[j+1]])*sum;j++;

	}

	for(int i=1;i<=n;i++)printf("%lld\n",ans[i]);

}




// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

#define int ll

//{ PXH612

using namespace std;

#define ll long long

#define db double

#define pp pair<int,int>

#define x first

#define y second



#define false(x) if(!(x))

template<typename A,typename B>bool Min(A &a,B b){if(a<=b) return 0;a=b;return 1;}

template<typename A,typename B>bool Max(A &a,B b){if(a>=b) return 0;a=b;return 1;}

#define in ({ll x=0;int o=0,c=char(),t=0;for(;!isdigit(c)&&t<1000;c=getchar(),t++) o=c=='-';for(;isdigit(c);c=getchar()) x=x*10+c-'0';o?-x:x;})

#define inchar ({char c=getchar();while(c==' '||c=='\n') c=getchar();c;})



#define FOR(i,a,b) for(int i=a,ENDFOR=b;i<=ENDFOR;i++)

#define ROF(i,a,b) for(int i=b,ENDFOR=a;ENDFOR<=i;i--)

#define RR(x,a,b) {cout<<#x<<": ";FOR(_,a,b) cout<<x[_]<<" ";cout<<"\n";}

#define rr(x) " "<<#x<<'='<<(x)<<" "



#define VEC(i,a) for(auto&i:a)

#define pb push_back

#define vn(a) (int)a.size()-1



#define bit(x,i) ((x>>(i-1))&1ll)

#define on(x,i) (x|(1ll<<(i-1)))

#define off(x,i) (x&~(1ll<<(i-1)))

#define mu(x) (1ll<<x)

#define bitnum(x) __builtin_popcountll(x)



#define segg(a,b) (abs(a-b)+1)

#define midd(a,b) (a+(b-(a))/2)

#define mems(x,a) memset(x,a,sizeof x)

#define open(a) freopen(a,"r",stdin)

#define shut(b) freopen(b,"w",stdout)

//}/////////////////////////////////////////////////////}



const int N=1e5+5;

int n;

int a[N],ans[N];

vector<int> e[N],v;



int low(int x){return lower_bound(v.begin(),v.end(),x)-v.begin();}

main()

{

  // open("frequency.inp");

    n=in;

    FOR(i,1,n) a[i]=in;

    FOR(i,1,n) v.pb(a[i]);



    v.pb(0);



    sort(v.begin(),v.end());

    v.erase(unique(v.begin(),v.end()),v.end());

    FOR(i,1,n) e[low(a[i])].pb(i);



    int cnt=0,mn=INT_MAX;

   // cout<<rr(v[0]) rr(v[1]) "\n";

    ROF(i,1,vn(v)) if(e[i].size())

    {

        VEC(j,e[i]) Min(mn,j);

        cnt+=e[i].size();

        ans[mn]+=cnt*(v[i]-v[i-1]);

    }

    FOR(i,1,n) cout<<ans[i]<<"\n";

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>



using namespace std;

#define ll long long

typedef pair<ll , ll> ii;

ll n , kq[100005];

map<ll, ll> m, idx;

vector<ii> t;

int main()

{

    cin >> n;

    for(int i = 1;i <= n;i++){

        ll foo; cin >> foo;

        m[foo]++;

        if(!idx.count(foo)) idx[foo] = i;

    }

    for(auto x = m.begin() ; x != m.end(); x++)

        t.push_back({x->first , x->second});

    sort(t.begin(), t.end());

    for(int i = t.size() - 1;i > 0;i--){

        kq[idx[t[i].first]] += (t[i].first - t[i - 1].first) * t[i].second;

        t[i - 1].second += t[i].second;

        idx[t[i - 1].first] = min(idx[t[i - 1].first] , idx[t[i].first]);

    }

    kq[idx[t[0].first]] += t[0].second * t[0].first;

    for(int i = 1;i <= n;i++) cout << kq[i] << "\n";

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <climits>

#include <stack>

#include <queue>

#include <string>

#include <set>

#include <map>

#include <math.h>

#include <algorithm>

#include <vector>

using namespace std;

typedef long long ll;

typedef pair<ll,ll> P;

long long int INF = 1e18;

double Pi = 3.141592653589;

const int mod = 1000000007;

vector<int> G[100005];

std::vector<P> tree[100010];

int dx[8]={1,0,-1,0,1,1,-1,-1};

int dy[8]={0,1,0,-1,1,-1,-1,1};

#define p(x) cout<<x<<endl;

#define e cout<<endl;

#define pe(x) cout<<x<<" ";

#define re(i,a,b) for(i=a;i<=b;i++)

ll i,j,k,l,ii,jj;

ll n,m;

string s,a[55555];

ll h,w,x,y,ans=0,sum;

ll ite;

int main(){

	cin>>s;

	cin>>ii;

	n=s.length();

	for(i=1;i<=5;i++){

		for(k=0;k+i<=n;k++){

			a[l]=s.substr(k,i);

			l++;

		}

	}

	sort(a,a+l);

	unique(a,a+l);

	p(a[ii-1]);

	system ("pause");

	return 0;

}

// Optimized solution to the same problem (faster):
#include <algorithm>

#include <iostream>

#include <string>

#include <vector>

using namespace std;

int main()

{

    string s;

    int k;

    cin>>s>>k;

	vector<string> v;

	for (int i=0;i<s.size();i++)

    {

		for(int j=1;j<=5;j++)

        {

			v.push_back(s.substr(i,j));

		}

	}

	sort(v.begin(),v.end());

	v.erase(unique(v.begin(),v.end()),v.end());

	k--;

	cout<<v[k]<<endl;

	//system ("pause");

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
/*

 * ARC097_C.cpp

 *

 *  Created on: May 12, 2018

 *      Author: 13743

 */



#include<iostream>

#include<vector>

#include<algorithm>

#include<queue>

#include<stack>

#include<cmath>



using namespace std;



int seq[30000] = {0};

int seq2[30000];



int powI(int x, int n) {

	int ans = 1;

	while(n--) {

		ans *= x;

	}

	return ans;

}



void quickSort(int l, int r, int* a, int* b) {

	if(l >= r) return;

	int piv = a[r];

	int i = l - 1;

	for(int j=l; j<r; j++) {

		if(a[j] <= piv) {

			i++;

			swap(a[i], a[j]);

			swap(b[i], b[j]);

		}

	}

	swap(a[i+1], a[r]);

	swap(b[i+1], b[r]);

	quickSort(l, i, a, b);

	quickSort(i+2, r, a, b);

}



int main() {

	int k;

	char s[5010];

	cin >> s;

	cin >> k;



	int n=0;

	for(int i=0; s[i]!='\0'; i++) {

		n++;

	}

	for(int i=0; i<5; i++) {

		s[n+i] = 'a'-1;

	}



	for(int i=0; i<n; i++) {

		for(int j=0; j<5; j++) {

			for(int k=0; k<=j; k++) {

				seq[5*i+j] += (s[i+k]-'a'+1)*powI(50, 4-k);

			}

		}

	}



	for(int i=0; i<=29000; i++) {

		seq2[i] = i;

	}



	quickSort(0, 5*n-1, seq, seq2);



	int ii=0;

	int num = -1;

	while(k > 0) {

//		cout << seq[ii] << endl;

		if(num != seq[ii]) {

			k--;

			num = seq[ii];

		}

		ii++;

	}

	ii--;

	int he = seq2[ii] / 5;

	int rem = seq2[ii] - he*5;

	for(int i=0; i<=rem; i++) {

		if(he+i < n)

			cout << s[he + i];

	}

	cout << endl;

}






// Optimized solution to the same problem (faster):
/*

 * ARC097_C.cpp

 *

 *  Created on: May 14, 2018

 *      Author: 13743

 */



#include<cstring>

#include<iostream>

#include<algorithm>

#include<vector>

#include<stack>

#include<queue>

#include<string>

using namespace std;

typedef long long llong;



#define PB push_back

#define SZ(a) int((a).size())

#define ALL(a) (a).begin(), (a).end

#define FOR(i, a, b) for(int i=(a); i<(b); ++i)

#define REP(i, n) FOR(i,0,n)

#define UNIQUE(a) a.erase(unique(ALL(a)), a.end())



int code[25000];

bool used[25000];



int powI(int x, int n) {

	int ans = 1;

	while(n--) {

		ans *= x;

	}

	return ans;

}



int main() {

	cin.tie(0);

	ios::sync_with_stdio(false);



	char str[5010];

	int K;

	cin >> str;

	cin >> K;



	int sLen = strlen(str);

	REP(i, sLen) {

		REP(j, 5) {

			REP(k, j+1) {

				if(i+k < sLen) {

					code[5*i+j] += (str[i+k]-'a'+1)*powI(50, 4-k);

				}

			}

		}

	}

	int minI = -1;

	while(K--) {

		int minS = 1<<30;

		REP(i, 5*sLen) {

			if(!used[i] && code[i]<minS) {

				minS = code[i];

				minI = i;

			}

		}

		REP(i, 5*sLen) {

			if(code[i] == minS) {

				used[i] = true;

			}

		}

	}

	int s = minI / 5;

	int t = minI % 5;

	REP(i, t+1) {

		cout << str[s+i];

	}

	cout << endl;

}








// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;



int main()

{

    int a,b;

    char str[105];

    scanf("%d %d %s",&a,&b,str);

    if(strlen(str)<(a+b+1))

    {

        puts("No");

        exit(0);

    }

    for(int i=0; i<a; i++)

    {

        if(str[i]>='0' && str[i]<='9')  continue;

        else

        {

            puts("No");

            exit(0);

        }

    }

    if(str[a]!='-')

    {

        puts("No");

        exit(0);

    }

    for(int i=(a+1); i<(a+b+1); i++)

    {

        if(str[i]>='0' && str[i]<='9')  continue;

        else

        {

            puts("No");

            exit(0);

        }

    }

    puts("Yes");

    return  0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	int a,b;

	char str[20];

	bool valids = true;

	

	scanf("%d %d", &a,&b);

	scanf("%s",str);

	

	if(str[a]!='-'){

	 valids = false;	

	}

	

	for (int i=0;str[i] !='\0';i++){

		if(i != a){

			if(str[i]<'0'){

				valids = false;

				break;

			}

		}

	}

	(valids) ? puts("Yes") : puts ("No");

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

int a,b,n;

int main()

{

    string s;

    cin>>a>>b;

    n=a+b;

    bool flag=false;

    cin>>s;

    if(s[a]!='-') flag=true;

    for(int i=0;i<=n;i++)

    {

        if(i==a) continue;

        if(!(s[i]>='0' && s[i]<='9')) flag=true;

    }

    if(!flag) cout<<"Yes"<<endl;

    else cout<<"No"<<endl;

    return 0;

}


// Optimized solution to the same problem (faster):
#include<stdio.h>



int main(){

	int a,b;

	char str[20];

	bool valids = true;

	

	scanf("%d %d", &a,&b);

	scanf("%s",str);

	

	if(str[a]!='-'){

	 valids = false;	

	}

	

	for (int i=0;str[i] !='\0';i++){

		if(i != a){

			if(str[i]<'0'){

				valids = false;

				break;

			}

		}

	}

	(valids) ? puts("Yes") : puts ("No");

	

	

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;



string pial[] = {"No", "Yes"};



int main() {

    int a, b;

    cin >> a >> b;

	string s;

	cin >> s;

	int ans = 1, pos = -1;

	for(int i = 0; i < a; i++) {

	    if(s[i] < '0' || s[i] > '9') {

	        ans = 0;

	        break;

	    }

	}

	if(s[a] != '-')

	    ans = 0;

	for(int i = a + 1; i < s.size(); i++) {

	    if(s[i] < '0' || s[i] > '9') {

	        ans = 0;

	        break;

	    }

	}

	cout << pial[ans] << endl;

	

	return 0;

}

// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	int a,b;

	scanf("%d %d", &a, &b);

	char s[255];

	scanf("%s", s);

	int angka = 0;

	for(int i = 0; s[i] != '\0'; i++){

		if(s[a] != '-'){

			puts("No");

			return 0;

		}

		if(s[i] >= '0' && s[i] <= '9'){

			angka++;

		}

	}

	if(angka == a+b){

		puts("Yes");

	}else{

		puts("No");

	}

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):


#include<bits/stdc++.h>

using namespace std;



char s[100060];

int main()

{

    int n,b,a,len,i,cnt=0;

    scanf("%d %d %s",&a,&b,s);

    len=strlen(s);



    if(len!=a+b+1)

    {

        printf("No");

        return 0;

    }



    for(i=0; i<a; i++)

    {

        if(s[i]=='-')

        {

            cnt++;

        }

    }



    if(s[a]!='-') cnt++;

    for(i=a+1; i<a+b+1; i++)

    {

        if(s[i]=='-') cnt++;

    }



    if(cnt==0) printf("Yes");

    else printf("No");



    return 0;

}










// Optimized solution to the same problem (faster):
#include <stdio.h>



int main() {

	int a,b;

	scanf("%d %d", &a, &b);

	char s[255];

	scanf("%s", s);

	int angka = 0;

	for(int i = 0; s[i] != '\0'; i++){

		if(s[a] != '-'){

			puts("No");

			return 0;

		}

		if(s[i] >= '0' && s[i] <= '9'){

			angka++;

		}

	}

	if(angka == a+b){

		puts("Yes");

	}else{

		puts("No");

	}

	return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define pb push_back

#define mp make_pair

#define lb lower_bound

#define ub upper_bound

#define F first

#define S second

#define sz(x) (int)x.size()

#define all(x) (x).begin(), (x).end()

#define Blue ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define rep(i,a,n) for(int i=a;i<n;++i)

typedef vector<int> vi;

typedef long long ll;

const int mod=1e9+7;

 

const int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

vector<ll>q;



ll getAns(ll m){

	ll x=0;

	auto it=upper_bound(all(q),m)-q.begin()-1;

	return it;

}



void solve(){

	ll n;

	cin>>n;

	ll ans=0;

	for(ll i=0;i<=1e4;i++){

		q.pb(((i+1)*i)/2);

	}

	for(ll i=2;i*i<=n;i++){

		ll cnt=0;

		while(n%i==0){

			cnt++;

			n/=i;

		}

		ans+=getAns(cnt);

	}

	if(n>1)ans++;

	cout<<ans;

 

}

 

 

int main(){

	Blue;

	int test=1;

	//cin>>test;

	while(test--)

		solve();

	return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define pb push_back

#define mp make_pair

#define lb lower_bound

#define ub upper_bound

#define F first

#define S second

#define sz(x) (int)x.size()

#define all(x) (x).begin(), (x).end()

#define Blue ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define rep(i,a,n) for(int i=a;i<n;++i)

typedef vector<int> vi;

typedef long long ll;

const int mod=1e9+7;

 

const int dx[]={1,-1,0,0},dy[]={0,0,1,-1};

vector<ll>q;



ll getAns(ll m){

	ll x=0;

	auto it=upper_bound(all(q),m)-q.begin()-1;

	return it;

}



void solve(){

	ll n;

	cin>>n;

	ll ans=0;

	for(ll i=0;i<=9;i++){

		q.pb(((i+1)*i)/2);

	}

	for(ll i=2;i*i<=n;i++){

		ll cnt=0;

		while(n%i==0){

			cnt++;

			n/=i;

		}

		ans+=getAns(cnt);

	}

	if(n>1)ans++;

	cout<<ans;

 

}

 

 

int main(){

	Blue;

	int test=1;

	//cin>>test;

	while(test--)

		solve();

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using ll = long long;

using vi = vector<int>;

using vvi = vector<vi>;



int main(){

  ll n;

  cin >> n;

  vector<ll> kosuu(10000,0);

  ll ruton = pow(n, 0.5);

  ll i=2, j=-1;

  int ans = 0;

  while(n!=1){

    if(n%i==0)j++;

    while(n%i==0){

      kosuu[j]++;

      n/=i;

    }

    i++;

    if(i==ruton){

      if(n==1) break;

      else{

        ans++;

        break;

      }

    }

  }



  rep(i,10000){

    int j=1;

    while(kosuu[i]-j >= 0){

      kosuu[i] -= j;

      j++;

      ans++;

    }

  }

  cout << ans << endl;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

using ll = long long;

using vi = vector<int>;

using vvi = vector<vi>;



int main(){

  ll n;

  cin >> n;

  vector<pair<ll, int>> fs;

  for(ll i=2; i*i<=n; i++){

    int kosuu=0;

    while(n%i==0){

      n/=i;

      kosuu++;

    }

    fs.emplace_back(i, kosuu);

  }

  if(n!=1) fs.emplace_back(n, 1);

  int ans=0;

  for(auto p: fs){

    int i=1;

    while(p.second-i >= 0){

      p.second -= i;

      i++;

      ans++;

    }

  }

  cout << ans << endl;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
 #include<bits/stdc++.h>

#include<iostream>

#include<algorithm>

#include<cstring>

#include<cstdio>

#include<cmath>

#define ll  long long

#define ull unsigned long long

#define IO ios::sync_with_stdio(false), cin.tie(0)

#define endl '\n'

#define main() int main()

#define ff1(i,n) for(int i=1;i<=n;++i)

#define ff0(i,n) for(int i=0;i<n;++i)

#define pi acos(-1.0)

#define ms(a, x) memset(a, x, sizeof(a))

#define lowbit(x) ((x)&(-(x)))

#define pb push_back

#define binarycount __builtin_popcount(x)

#define tr t[root]

#define lson t[root << 1]

#define rson t[root << 1 | 1]

#define fir first

#define sec second

#define debug(x) cout<<x<<'\n'

#define sa(a) scanf("%d", &a)

#define sab(a, b) scanf("%d%d", &a, &b)

#define pa(a) printf("%d",a)

#define pab(a,b) printf("%d%d",a,b)

#define pii pair<ll,ll>

using namespace std;



#define maxn 1000005

const int inf = 0x3f3f3f3f;

const int mod = 1e9+7;

const double eps = 1e-8;

ll gcd(ll a, ll b) {return b==0?a:gcd(b, a%b);}

ll lcm(ll a, ll b) {return a/gcd(a, b)*b;}

ll powmod(ll a,ll b){

    ll ans = 1, pow = a%mod;

    while(b) { if(b&1) ans = (ans*pow)%mod; pow = (pow*pow)%mod; b >>= 1; }

    return ans%mod;

}

main()

{  

    ll n;

	cin>>n; 

    vector<pair<ll, ll>> v;

    for (ll i=2;i*i<=n;i++){

        if (n%i==0) {

            v.pb(pii(i, 0));

            while (0==n%i) {

                v.back().second++;

                n/=i;

            }

        }

    }

    if (n>1) {

        v.pb(pii(n, 1));

    }

    ll ans=0;

    for (pii &p:v) {

        ll i=sqrt(p.second*2);

        if (i*(i+1)>p.second*2)  i--;

        ans+=i;

    }

 

    cout<<ans<<endl;

}

 

// Optimized solution to the same problem (faster):
#include <stdio.h>

#define LL long long

int p[50],m[50],tot;//p[]记录质数,m[]记录幂次

int main(){

	LL n;

	int i,j,ans=0;

	scanf("%lld",&n);

	for(i=2;(LL)i*i<=n;i++)//注意此处不能写成for(i=2;i*i<=n;i++)

		if(n%i==0){

			p[++tot]=i;

			while(n%i==0)n/=i,m[tot]++;

		}

	if(n>1)p[++tot]=n,m[tot]=1;

	for(i=1;i<=tot;i++){

		j=1;

		while(1){

			if(m[i]>=j)ans++,m[i]-=j;

			else break;

			j++;

		}

	}

	printf("%d\n",ans);

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

//動画解説写し

struct Sieve{

  int n;

  vector<int>f,primes;

  Sieve(int n=1):n(n),f(n+1){

  /*  f[0]=f[1]=-1;

    for(long long i=2;i<=n;++i){

      if(f[i])continue;

      primes.push_back(i);

      f[i]=i;

      for(long long j=i*i;j<=n;j+=i){

        if(!f[j])f[j]=i;

      }

    }*/

  }

vector<pair<long long,int>>factor(long long x){

  vector<pair<long long,int>>res;

  for(long long i=2;i*i<=x;++i){

    int y=0;

    while(x%i==0){

      x/=i;

      ++y;

    }

    if(y!=0)res.emplace_back(x,y);

  }

  if(x!=1)res.emplace_back(x,1);

  return res;

}

};

int main(){

  long long n;

  cin>>n;

  Sieve s(1000005);

  auto fs=s.factor(n);

  int ans=0;

  for(auto p:fs){

    int x=p.second;

    int b=1;

    while(b<=x){

      x-=b;

      b++;

      ++ans;

    }

  }

  cout<<ans<<endl;

  return 0;

}

// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

//

struct Sieve{

  vector<pair<long long,int>>factor(long long x){//素因数分解（素数、何個あるか）

    vector<pair<long long,int>>res;

    for(long long i=2;i*i<=x;++i){

      int y=0;

      while(x%i==0){

        x/=i;

        ++y;

      }

      if(y!=0)res.emplace_back(x,y);

    }

    if(x!=1)res.emplace_back(x,1);

    return res;

  }

};

int main(){

  long long n;

  cin>>n;

  Sieve s;

  auto fs=s.factor(n);

  int ans=0;

  for(auto p:fs){

    int x=p.second;

    int b=1;

    while(b<=x){

      x-=b;

      b++;

      ++ans;

    }

  }

  cout<<ans<<endl;

  return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

using namespace std;

#define ull unsigned long long int

int main() {



	ull N; cin >> N;

	int ans = 0;

	for(int i=2;i<=1000000;++i) {

		int cur = 0;

		while (N % i == 0) {

			cur++;

			N /= i;

		}

		for(int j=1;j<=cur;++j) {

			if (cur < j) break;

			ans++; cur -= j;

		}

	}

	if (N > 1) ans++;

	cout << ans << endl;



	return 0;

}


// Optimized solution to the same problem (faster):
#include <bits/stdc++.h>

using namespace std;

#define ull unsigned long long int

int main() {

 

	ull N; cin >> N;

	int ans = 0;

	for(int i=2;i*1LL*i<=N;++i) {

		int cur = 0;

		while (N % i == 0) {

			cur++;

			N /= i;

		}

		for(int j=1;j<=cur;++j) {

			if (cur < j) break;

			ans++; cur -= j;

		}

	}

	if (N > 1) ans++;

	cout << ans << endl;

 

	return 0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<stdio.h>

const int e[40]={0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,

                 5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8};

int main(void)

{

  int i,x;

  long long a=0,N;

  x=scanf("%lld",&N)-1;

  while(N%2==0){x++;N/=2;}

  a+=e[x];

  for(i=3;i<=1e6;i+=2)

  {

    x=0;while(!(N%i))x++,N/=i;

    a+=e[x];

  }

  if(N>1)a++;

  return printf("%lld\n",a),0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

typedef long long LL;

const int e[40]={0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,

                 5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8};

LL IN(void)

{

  LL x=0;short f=0,c=getchar();

  while(c<48||c>57)f^=c==45,c=getchar();

  while(c>47&&c<58)x=x*10+c-48,c=getchar();

  return f?-x:x;

}

int main(void)

{

  int x=0;LL a=0,p=1,q=-1,N=IN();

  while(N%2==0){x++;N/=2;}a+=e[x],x=0;

  while(N%3==0){x++;N/=3;}a+=e[x];

  while(q*q<=N)

  {

    p+=6,q+=6;

    x=0;while(!(N%p)){x++;N/=p;}a+=e[x];

    x=0;while(!(N%q)){x++;N/=q;}a+=e[x];

  }

  if(N>1)a++;

  return printf("%lld\n",a),0;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<stdio.h>

#include<math.h>

const int e[40]={0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,

                 5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8};

int main(void)

{

  int i,x;

  long long a=0,N;

  x=scanf("%lld",&N)-1;

  while(N%2==0){x++;N/=2;}

  a+=e[x];

  for(i=3;i<=(int)sqrt(N);i+=2)

  {

    x=0;while(!(N%i))x++,N/=i;

    a+=e[x];

  }

  if(N>1)a++;

  return printf("%lld\n",a),0;

}

// Optimized solution to the same problem (faster):
#include<stdio.h>

typedef long long LL;

const int e[40]={0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,

                 5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8};

LL IN(void)

{

  LL x=0;short f=0,c=getchar();

  while(c<48||c>57)f^=c==45,c=getchar();

  while(c>47&&c<58)x=x*10+c-48,c=getchar();

  return f?-x:x;

}

int main(void)

{

  int x=0;LL a=0,p=1,q=-1,N=IN();

  while(N%2==0){x++;N/=2;}a+=e[x],x=0;

  while(N%3==0){x++;N/=3;}a+=e[x];

  while(q*q<=N)

  {

    p+=6,q+=6;

    x=0;while(!(N%p)){x++;N/=p;}a+=e[x];

    x=0;while(!(N%q)){x++;N/=q;}a+=e[x];

  }

  if(N>1)a++;

  return printf("%lld\n",a),0;

}

// Fastest known solution for this problem: