#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int cases = 1;
  while (cases--) {
    long long int n;
    cin >> n;
    if (n % 2 == 1)
      cout << "1\n";
    else
      cout << "0\n";
  }
  return 0;
}
