#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  cin >> s;
  int num = 0;
  for (char c : s) {
    int d = c <= '9' ? c - '0' : c - 'A';
    num = 16 * num + d;
  }
  cout << num % 2;
}
