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 n. Initially the value of n equals to v 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 and x is not a divisor of n, then subtract x from n. 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 (1 ≤ v ≤ 10^9), the initial value of n.

Output

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

Examples

Input


8


Output


1


Input


1


Output


1

Note

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

In the second example, since n=1 initially, the player can do nothing.
#include <bits/stdc++.h>
using namespace std;
long long int M = 1e9 + 7;
long long int n, k, m;
long long int z, q, u, a1, l, r, ax, cx, ay, by, cy, ql, qr, d, x, y;
long long int w[300007];
vector<pair<long long int, long long int> > v[400000];
map<long long int, long long int> dp;
long long int ma = 0;
long long int tot = 0;
long long int solve(long long int i, long long int p) {
  if (dp.find(i) != dp.end()) return dp[i];
  long long int idx = 0;
  for (auto v1 : v[i]) {
    if (v1.first == p) continue;
    long long int d = solve(v1.first, i) - v1.second;
    if (dp[i] <= d) {
      dp[i] = d;
      idx = v1.first;
    }
  }
  long long int d1 = dp[i];
  long long int d2 = 0;
  for (auto v1 : v[i]) {
    if (v1.first == p) continue;
    long long int d = solve(v1.first, i) - v1.second;
    if (d2 <= d && v1.first != idx) {
      d2 = d;
    }
  }
  dp[i] = d1 + d2 + w[i];
  dp[i] = max(dp[i], d1 + w[i]);
  dp[i] = max(dp[i], d2 + w[i]);
  dp[i] = max(dp[i], w[i]);
  tot = max(tot, dp[i]);
  dp[i] = max(d1 + w[i], w[i]);
  return dp[i];
}
int main() {
  cin >> n;
  if (n == 2)
    cout << 2;
  else
    cout << 1;
}
