#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  int answer;
  cin >> N;
  answer = N % 2;
  if (answer = 0) {
    cout << answer << endl;
  } else {
    cout << answer + 1 << endl;
  }
}
