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