
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)


map<ll,int> prime_factorization(ll n){
	map<ll,int> ret;
	
	for(ll div=2;div<=1+sqrt(n);div++){
		while(n%div==0){
			ret[div]++;
			n/=div;
		}
	}
	if(n!=1)ret[n]++;
	return ret;
}

int main(){
	ll n;
	while(cin>>n&&n){
		map<ll,int> mp = prime_factorization(n);
		int m = mp.size();
		vector<int> num;
		for(auto &elm:mp) num.pb(elm.second);
		int c=0;
		ll ans = 0;
		rep(i,1<<m){
			rep(j,1<<m){
				if( (i|j) != ((1<<m)-1) )continue;
				if(i==j){
					ans+=2;
					continue;
				}
				ll tmp = 1;
				rep(k,m){
					if( (i&(1<<k))==0 )tmp*=num[k];
					if( (j&(1<<k))==0 )tmp*=num[k];
				}
				ans+=tmp;
			}
		}
		cout<<ans/2<<endl;
	}
}