Under construction

Still being built. Things may change

Factorial Fraction Equation

Time limit2sMemory limit512 MB

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

Hard8 of 10

Topics
Number theory, Combinatorics, Math, Implementation
Solved
No attempts yet

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 X≠YX \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 (1≤N≤1041 \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.

Examples2

  1. Example 1

    Input
    1
    
    Expected output
    1
    
  2. Example 2

    Input
    2
    
    Expected output
    3