Factorial Fraction Equation

Count ordered pairs of positive integers (X, Y) satisfying 1/N! = 1/X + 1/Y, printing the exact value with no modulus.

Hard8Number theoryCombinatoricsMathImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

You are given a positive integer NN. Write a program that counts the ordered pairs of positive integers (X,Y)(X, Y) satisfying the equation below.

1N!=1X+1Y\frac{1}{N!} = \frac{1}{X} + \frac{1}{Y}

Order matters. When XYX \ne Y, the pairs (X,Y)(X, Y) and (Y,X)(Y, X) count as two different solutions.

Input

The first line contains the integer NN (1N1041 \le N \le 10^4).

Output

Print the number of solutions on the first line. The count grows very large, so print the exact value without taking any modulus.