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