#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, f, g, x, y, x1, y_1, x2, y2;
bool used[1005];
bool h[1001][1001];
vector<int> prostik;
string s;
void read() {
  cin >> s;
  f = 100000;
  for (int i = 1; i < s.size(); i++) {
    a += (s[i] - '0') * f;
    f /= 10;
  }
}
void prost() {
  f = 1;
  while (f <= 500) {
    f++;
    while (used[f] == 1) {
      f++;
    }
    for (int i = f + f; i <= 1000; i += f) {
      used[i] = 1;
    }
  }
  for (int i = 2; i <= 1000; i++) {
    if (used[i] == 0) prostik.push_back(i);
  }
}
void solve() {
  for (int i = 1; i <= a; i++) {
    for (int j = 2; j <= 1000; j++) {
      if (h[i][j] == 1) cout << j << " ";
    }
    cout << '\n';
  }
}
void write() { cout << a % 2; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int q;
  read();
  write();
}
