#include<bits/stdc++.h>
using namespace std;

using i64 = int64_t;

map<i64, i64> prime_factor(i64 n) {
    map<i64, i64> res;
    for (i64 i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            res[i]++;
            n /= i;
        }
    }
    if (n != 1)
        res[n] = 1;
    return res;
}

int main(){
    i64 l;
    while(cin >> l, l != 0){
        auto mp = prime_factor(l);
        i64 n = 1;
        for(auto e: mp){
            n *= 2*e.second + 1;
        }
        cout << (n+1) / 2 << endl;
    }

    return 0;
}

