Problem:
Problem J: No Story

Since I got tired to write long problem statements, I decided to make this problem statement short. For given positive integer L, how many pairs of positive integers a, b (a ≤ b) such that LCM(a, b) = L are there? Here, LCM(a, b) stands for the least common multiple of a and b.

Input

For each dataset, an integer L is given in a line. Input terminates when L = 0.

Output

For each dataset, output the number of pairs of a and b.

Constraints

1 ≤ L ≤ 1012

Sample Input

12
9
2
0

Output for the Sample Input

8
3
2

Solution in C (judge verdict: Accepted)

#include<stdio.h>
long long div[100000];
long long inde;
 
void getDiv(long long n){
  inde = 0;
  long long i;
  for(i=1;i*i<=n;i++)
    if(n%i == 0)
    {
      div[inde++] = i;
      if(i != n/i)
        div[inde++] = n/i;
    }
}
 
long long gcd(long long x,long long y)
{
  long long r;
  if(x < y)
    {
      long long tmp = x;
      x = y;
      y = tmp;
    }
  while(y > 0)
    {
      r = x%y;
      x = y;
      y = r;
    }
  return x;
}
 
int main()
{
  long long n;
   
  while(1)
    {
      scanf("%lld",&n);
      if(n == 0)
    break;
      long long cnt = 0;
      long long i,j;
      getDiv(n);
      for(i=0;i<inde;i++)
    {
      for(j=i;j<inde;j++)
        {
          long long a,b;
          a = div[i];
          b = div[j];
          if(a/gcd(a,b)*b == n)
        cnt++;
        }
    }
      printf("%lld\n",cnt);
    }
   
  return 0;
}