#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define dump(x) cout << #x << " = " << (x) << endl;
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if(n == 0) {
    cout << 1 << endl;
  } else if(n == 1) {
    cout << 2 << endl;
  } else if(n == 2) {
    cout << 1 << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}
