CF1081A.Definite Game

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Definite Game

Chouti was doing a competitive programming competition. However, after having all the problems accepted, he got bored and decided to invent some small games.

He came up with the following game. The player has a positive integer nn. Initially the value of nn equals to vv and the player is able to do the following operation as many times as the player want (possibly zero): choose a positive integer xx that x<nx \lt n and xx is not a divisor of nn, then subtract xx from nn. The goal of the player is to minimize the value of nn in the end.

Soon, Chouti found the game trivial. Can you also beat the game?

Input

The input contains only one integer in the first line: vv (1v1091 \le v \le 10^9), the initial value of nn.

Output

Output a single integer, the minimum value of nn the player can get.

Note

In the first example, the player can choose x=3x=3 in the first turn, then nn becomes 55. He can then choose x=4x=4 in the second turn to get n=1n=1 as the result. There are other ways to get this minimum. However, for example, he cannot choose x=2x=2 in the first turn because 22 is a divisor of 88.

In the second example, since n=1n=1 initially, the player can do nothing.

Samples

8
1
1
1

在线编程 IDE

建议全屏模式获得最佳体验