#include <bits/stdc++.h>
using namespace std;
const int maxn = 10e5 + 5;
long long a, b, c, d, e, f, g, n, m, i, j, sdg[maxn], lili, t;
long long x[2001][2001], z[maxn], v[200001], h[100001];
string p, s;
queue<int> q;
bool mark[maxn];
vector<long long> o[maxn], sgd;
map<long long, long long> mp;
char l, y;
int main() {
  for (i = 0; i < 7; i++) {
    cin >> s[i];
  }
  if (s[6] % 2 == 0) {
    cout << 0;
  } else {
    cout << 1;
  }
  return 0;
}
