#abc161f. [abc161_f]Division or Subtraction

[abc161_f]Division or Subtraction

Problem Statement

Given is a positive integer NN.

We will choose an integer KK between 22 and NN (inclusive), then we will repeat the operation below until NN becomes less than KK.

  • Operation: if KK divides NN, replace NN with N/KN/K; otherwise, replace NN with NKN-K.

In how many choices of KK will NN become 11 in the end?

Constraints

  • 2leqNleq10122 \\leq N \\leq 10^{12}
  • NN is an integer.

Input

Input is given from Standard Input in the following format:

NN

Output

Print the number of choices of KK in which NN becomes 11 in the end.


Sample Input 1

6

Sample Output 1

3

There are three choices of KK in which NN becomes 11 in the end: 22, 55, and 66.

In each of these choices, NN will change as follows:

  • When K=2K=2: 6to3to16 \\to 3 \\to 1
  • When K=5K=5: 6to16 \\to 1
  • When K=6K=6: 6to16 \\to 1

Sample Input 2

3141

Sample Output 2

13

Sample Input 3

314159265358

Sample Output 3

9