#P5253. [JSOI2013] 丢番图

[JSOI2013] 丢番图

Background

Diophantus was a famous mathematician in Egypt during the Alexandrian period. He was one of the earliest mathematicians to study indeterminate equations with integer coefficients.

To honor him, such equations are generally called Diophantine equations. One of the most famous Diophantine equations is

xn+yn=znx^n+y^n=z^n

Fermat proposed that for n>2n>2, x,y,zx,y,z have no positive integer solutions. This is called “Fermat's Last Theorem”, and its proof was not completed until recently by Andrew Wiles (AndrewWiles).

Problem Description

Consider the following Diophantine equation:

$$\frac{1}{x}~+~\frac{1}{y}~=~\frac{1}{n}~,(x,y,n~\in~\mathbb{N}^+)$$

Xiao G is very interested in the following question: for a given positive integer nn, how many essentially different solutions satisfy the equation above? For example, when n=4n=4, there are three essentially different solutions (x  y)(x~\leq~y):

15+120 = 14\frac{1}{5}+\frac{1}{20}~=~\frac{1}{4}

16+112 = 14\frac{1}{6}+\frac{1}{12}~=~\frac{1}{4}

18+18 = 14\frac{1}{8}+\frac{1}{8}~=~\frac{1}{4}

Obviously, for larger nn, it is meaningless to list all essentially different solutions. Can you help Xiao G quickly find, for a given nn, the number of essentially different solutions to the equation above?

Input Format

One line with only one integer nn.

Output Format

Output one line with one integer, representing the answer.

4
3

Hint

Constraints

For all testdata, it is guaranteed that 1n10141 \leq n \leq 10^{14}.

Translated by ChatGPT 5