#include <bits/stdc++.h>
using namespace std;
int main() {
  string a;
  cin >> a;
  long long int q = a.size();
  if (a[q - 1] == '2' || a[q - 1] == '4' || a[q - 1] == '6' ||
      a[q - 1] == '8' || a[q - 1] == '0') {
    cout << 0;
  } else {
    cout << 1;
  }
}
