#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void program();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  program();
}
const int MX = 5e5;
string s;
void program() {
  cin >> s;
  if ((s.back() - '0') % 2) {
    cout << 1 << endl;
  } else {
    cout << 0 << endl;
  }
}
