Problem: 

Input

The input contains a single integer a (0 ≤ a ≤ 35).

Output

Output a single integer.

Examples

Input

3


Output

8


Input

10


Output

1024

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const int LIM = 14;
int tle() {
  while (true)
    ;
}
int rte() { return 1 / 0; }
int solve(int x) {
  if (x == 0) return 15;
  if (x == 1) return 14;
  if (x == 2) return 12;
  if (x == 3) return 13;
  if (x == 4) return 8;
  if (x == 5) return 9;
  if (x == 6) return 10;
  if (x == 7) return 11;
  if (x == 8) return 0;
  if (x == 9) return 1;
  if (x == 10) return 2;
  if (x == 11) return 3;
  if (x == 12) return 4;
  if (x == 13) return 5;
  if (x == 14) return 6;
  if (x == 15) return 7;
  if (x <= LIM) return rte();
  if (x > LIM) return tle();
}
int main() {
  int x;
  cin >> x;
  cout << solve(x) << endl;
  return 0;
}