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;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(time(NULL));
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 3; i >= 0; --i) {
    bool ok = true;
    for (int j = i + 1; j <= 3; ++j) {
      if (!(ans & (1 << j))) ok = false;
    }
    if (ok) n ^= (1 << i);
    ans += ((1 << i) & n);
  }
  cout << ans;
  return 0;
}