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() {
  int n;
  cin >> n;
  int a[5];
  memset(a, 0, sizeof(a));
  int j = 0;
  while (n) {
    a[j] = n % 2;
    n = n / 2;
    j++;
  }
  reverse(a, a + 4);
  for (int i = 0; i < 4; i++) {
    if (a[i] == 0)
      a[i] = 1;
    else {
      a[i] = 0;
      break;
    }
  }
  reverse(a, a + 4);
  long long int ans = 0;
  for (int i = 3; i >= 0; i--) {
    ans = (ans * 2) + a[i];
  }
  cout << ans << endl;
}