#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
#include <map>
#include <bitset>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

typedef long long Int;
typedef pair<Int,Int> pii;

int main() {
  const int N = 1050000;
  vector<int> prime(N);
  REP(i,N) prime[i]=i;
  prime[0] = prime[1] = 0;
  for (int i=2; i<N; ++i)
    if (prime[i])
      for (int j=2*i; j<N; j+=i)
        prime[j] = 0;
  prime.erase(remove(ALL(prime), 0), prime.end());
    
  Int n;
  while(cin >> n, n) {
    Int sr = sqrt(n);
    map<int,int> mp;
    for (int i=0; n>1 && prime[i]<=sr; ++i) {
      while(!(n%prime[i])) {
        n /= prime[i];
        mp[prime[i]]++;
      }
    }
    if (n!=1) mp[n]++;

    Int m = mp.size();
    
    vector<pii> v;
    FOR(it, mp) 
      v.push_back(pii(it->first, it->second));
    Int res = 0;
    REP(S, 1<<m) {
      Int tmp = 1;
      REP(i,m) {
        if ((S>>i)&1)
          tmp *= v[i].second + 1;
        else {
          if (v[i].second >= 2) {
            tmp *= v[i].second;
          }
        }
          
      }
//      cout << bitset<10>(S) << " " << tmp<<endl;
      res += tmp;
    }
    cout << (res+1)/2 << endl;
  }
}