#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

#define int long long
#define PB push_back

int gcd(int a, int b)
{
    int tmp;
    while (b) {
        tmp = a;
        a = b;
        b = tmp % b;
    }
    return a;
}

inline int lcm(int a, int b)
{
    return a / gcd(a, b) * b;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);

    int L;
    
    while (cin >> L, L) {
        vector<int> divisors;

        for (int i = 1; i * i <= L; ++i) {
            if (L % i == 0) {
                divisors.PB(i);
                if (i * i != L) divisors.PB(L / i);
            }
        }

        sort(begin(divisors), end(divisors));

        int ans = 0;

        for (int i = 0; i < (int)divisors.size(); ++i) {
            for (int j = 0; j <= i; ++j) {
                int ii = divisors[i], jj = divisors[j];

                if (lcm(ii, jj) == L) {
                    ans++;
                }
            }
        }

        cout << ans << endl;
    }
}