#include<iostream>
#include<algorithm>
#include<cmath>
#include<set>
#include<vector>
using namespace std;
typedef long long ll;

vector<ll> getDiv(ll n){
  vector<ll> res;
  for(ll i=1;i*i<=n;i++)
    if(n%i == 0)
	{
	  res.push_back(i);
	  if(i*i != n)
	    res.push_back(n/i);
	}
  return res;
}

int main()
{
  long long n;
  while(cin >> n,n)
    {
      int cnt = 0;
      vector<ll> s = getDiv(n);
      for(int i= 0;i<s.size();i++)
	{
	  for(int j=i;j<s.size();j++)
	    {
	      ll a,b;
	      a = s[i];
	      b = s[j];
	      if(a/__gcd(a,b)*b == n)
		cnt++;
	    }
	}
      cout << cnt << endl;
    }
  return 0;
}