#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, n, sum1, sum2, f, d, i, x, k, y, z, w, sum, j, u, v, c, m, r;
  cin >> n;
  if (n % 2 == 0) {
    cout << "0";
  } else {
    cout << "1";
  }
  return 0;
}
