CodeforcesJun 18, 2025

Definite Game

Hazrat Ali

Codeforces

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 x that x<N<n and x is not a divisor of nn, then subtract x from nn. The goal of the player is to minimize the value of n 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: v (1v109), the initial value of nn.

Output

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

Examples
Input
8
Output
1
Input
1
Output
1


Solution

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  int ans = (n == 2) ? 2 : 1;
  cout << ans << endl;
  return 0;
}




Comments