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 t[10000];
void to2(int a) {
  int i;
  for (i = 0; a != 0; i++) {
    t[i] = a % 2;
    a /= 2;
  }
}
void Swap() {
  swap(t[0], t[3]);
  swap(t[1], t[2]);
}
void jian() {
  int i;
  t[0]--;
  for (i = 1; t[i - 1] < 0; i++) {
    t[i]--;
    t[i - 1] += 2;
  }
}
int to10() {
  int i;
  int sum = 0, xyq = 1;
  for (i = 0; i <= 3; i++) {
    sum += t[i] * xyq;
    xyq *= 2;
  }
  return sum;
}
int main() {
  int a;
  cin >> a;
  if (a == 0) {
    cout << 15;
    return 0;
  }
  to2(a);
  Swap();
  jian();
  Swap();
  cout << to10();
}