#include <bits/stdc++.h>
using namespace std;
int main() {
  char a[7];
  cin >> a;
  int p = a[6] - '0';
  if (p % 2 == 0) {
    cout << "0" << endl;
  } else if (p % 2 != 0) {
    cout << "1" << endl;
  }
  return 0;
}
