#include <bits/stdc++.h>
using namespace std;
void swap(long long int *p1, long long int *p2) {
  long long int temp = *p1;
  *p1 = *p2;
  *p2 = temp;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int x = s[s.length() - 1];
  x = x - 48;
  if (x % 2 == 0)
    cout << 0;
  else
    cout << 1;
  return 0;
}
