No Story (AOJ 1060) by letter
Contest: 3575    RunID: 2378933    Status: Accepted    Date: Mon Jun 19 16:15:20 JST 2017


#include<bits/stdc++.h>
using namespace std;
  
#define REP(i,s,n) for(int i=s;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define SORT(c) sort((c).begin(),(c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
  
typedef long long ll;
typedef pair<int, int> ii;
 
#define DEBUG false
 
#define MAXI 1000001
 
vector<ll> prime;
 
int main(){
 
    ll l;
    bool used[MAXI] = {false};
    REP(i, 2, MAXI){
        if(!used[i]) prime.push_back(i);
        for(int j = 2; i * j < MAXI; j++) used[i*j] = true;
    }
     
    while(cin >> l, l){
        ll tmp = l;
        ll ans = 1;
        ll mul = 1;
        rep(i, prime.size()){
        	ll cnt = 0;
            while(tmp != 1 && tmp % prime[i] == 0) {
                cnt++;
                tmp /= prime[i];
            }
            mul *= (cnt * 2 + 1);
        }
        if(tmp >= MAXI) mul *= 3;
        ans += mul;
        cout << ans / 2 << endl;
    }
     
     
     
    return 0;
}