#abc212g. [abc212_g]Power Pair

[abc212_g]Power Pair

Problem Statement

Given is a prime number PP.

How many pairs of integers (x,y)(x, y) satisfy the following conditions?

  • 0leqxleqP10 \\leq x \\leq P-1
  • 0leqyleqP10 \\leq y \\leq P-1
  • There exists a positive integer nn such that xnequivypmodPx^n \\equiv y \\pmod{P}.

Since the answer may be enormous, print it modulo 998244353998244353.

Constraints

  • 2leqPleq10122 \\leq P \\leq 10^{12}
  • PP is a prime number.

Input

Input is given from Standard Input in the following format:

PP

Output

Print the answer modulo 998244353998244353.


Sample Input 1

3

Sample Output 1

4

Four pairs (x,y)=(0,0),(1,1),(2,1),(2,2)(x, y) = (0, 0), (1, 1), (2, 1), (2, 2) satisfy the conditions.


Sample Input 2

11

Sample Output 2

64

Sample Input 3

998244353

Sample Output 3

329133417