#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  char a;
  cin >> a;
  long long n;
  cin >> n;
  if ((n & 1) == 0)
    cout << 0 << endl;
  else
    cout << 1 << endl;
  return 0;
}
