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: Time Limit Exceeded)

#include<stdio.h>

int kaijo(int);

int main(void){
  int L,a,n,count,flag;

  while(1){

      scanf("%d",&L);
      if(L==0)break;

      flag=0;
      n=L;
      count=0;
      a=2;

      while(n>a*a){
	if(n%a==0){
	  count++;
	  n=n/a;
	}
	else {
	  a++;
	  if(n==a*a && n%a==0)flag=1;
	}
      }

      printf("%d\n",(count!=0 || flag==1)?kaijo(count+1)+2:2);
  }

    return 0;
}

int kaijo(int x){

  int i,ans=1;

  for(i=2;i<=x;i++)
    ans*=i;

  return ans;
}