// Aizu Vol-10 1060: No Story
// 2017.10.7 bal4u@uu

#include <stdio.h>
#include <math.h>

#define SIZE  15
int size;
int factor[SIZE], power[SIZE];

void prime_factor(int n)
{
    int i;
    int sw;
    
    size = 0;
    if ((n & 1) == 0) {
        factor[size] = 2, power[size] = 0;
        do n >>= 1, power[size]++;
        while ((n & 1) == 0);
        size++;
    }
    if (n % 3 == 0) {
        factor[size] = 3, power[size] = 0;
        do n /= 3, power[size]++;
        while (n % 3 == 0);
        size++;
    }
    if (n > 1) {
        int b = (int)sqrt(n);
        for (i = 5, sw = 1; n > 1; ) {
            if (i > b) { factor[size] = n, power[size++] = 1; break; }
            if (n % i == 0) {
                factor[size] = i, power[size] = 0;
                do n /= i, power[size]++;
                while (n % i == 0);
                size++;
            }
            if (sw) i += 2, sw = 0;
            else    i += 4, sw = 1;
        }
    }
}

int main()
{
	int n, i, ans;

	while (scanf("%d", &n) && n > 0) {
        prime_factor(n);
		for (ans = 1, i = 0; i < size; i++) ans *= 1 + (power[i] << 1);
		ans = (ans + 1) / 2;
        printf("%d\n", ans);
	}
	return 0;
}