#include <bits/stdc++.h>
using namespace std;
unsigned long long rec(unsigned long long n) {
  for (unsigned long long i = n - 1; i >= 1; i--) {
    if (n % i != 0) {
      return rec(n - i);
    }
  }
  return n;
}
int main() {
  unsigned long long n;
  cin >> n;
  cout << rec(n) << endl;
  return 0;
}
