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 JAVA (judge verdict: Accepted)

import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		try(Scanner sc = new Scanner(System.in)){
			//例 12=2*2*3=2^2 * 3^1
			//a=2^p * 3^q
			//b=2^t * 3^s
			//p, tが少なくとも一つ2である必要
			//p,tの並びは(2+1)*(2+1)
			//全部2でない並びは 2*2
			//よって少なくとも一つ2であるのは(2+1)*(2+1)-2*2
			//q,sも同様
			while (sc.hasNext()) {
				long L = sc.nextLong();
				if (L == 0) break;
				long ans = 1;
				for(long i=2; i*i<=L; i++) {
					if(L%i != 0) continue;
					L/=i;
					int count=1;
					while(L%i == 0) {
						L/=i;
						count++;
					}
					ans*=(count+1)*(count+1)-count*count;
				}
				if(L!=1) {
					ans*=2*2-1*1;
				}
				System.out.println((ans+1)/2);
			}
			
		}
	}
}