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>
char p[1000020]={1,1};
int main(){
  long long n,i,j,s=1,d[100010],c,M=1000010;
  for(i=0;i*i<M;i++){
    if(p[i])continue;
    for(j=i*i;j<M;j+=i)p[j]=1;
  }
  for(i=c=0;i<M;i++){
    if(p[i]==0)d[c++]=i;
  }//printf("%lld %lld\n",M*M,c);
  //for(i=0;s*d[i]<1e12;i++)s*=d[i];printf("%lld\n",s);
  while(scanf("%lld",&n),n){
    s=1;
    for(i=0;n-1&&i<c;i++){
      for(j=0;n%d[i]==0;j++)n/=d[i];//,printf("%lld %lld\n",n%d[i],j);
      s*=j+j+1;
    }
    if(n-1)s*=3;
    printf("%lld\n",s/2+1);
  }
  return 0;
}