import std.stdio;
import std.string;
import std.conv;
import std.functional;

ulong _pow(ulong x, ulong e) {
    ulong ans = 1;
    foreach (i; 0 .. e) {
        ans *= x;
    }
    return ans;
}
alias memoize!_pow pow;

ulong solve(ulong L) {
    ulong[ulong] factor;
    ulong[] primes;
    for (ulong i = 2; i * i <= L; i++) {
        if (L % i == 0) {
            primes ~= i;
            factor[i] = 1;
            L /= i;
        }
        while (L % i == 0) {
            factor[i]++;
            L /= i;
        }
    }
    if (L != 1) {
        primes ~= L;
        factor[L] = 1;
    }
    ulong count(ulong index, ulong a, ulong b) {
        if (index >= primes.length) {
            if (a > b) return 0;
            else return 1;
        }
        ulong p = primes[index];
        ulong c = factor[p];
        ulong ans = 0;
        foreach (i; 0 .. c) {
            ans += count(index + 1, a * p.pow(i), b * p.pow(c));
            ans += count(index + 1, a * p.pow(c), b * p.pow(i));
        }
        ans += count(index + 1, a * p.pow(c), b * p.pow(c));
        return ans;
    }
    return count(0, 1, 1);
}

void main() {
    ulong L;
    while (L = readln.chomp.to!ulong, L) {
        solve(L).writeln;
    }
}