<image>

Input

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

Output

Output a single integer.

Example

Input


3


Output


13
#include <bits/stdc++.h>
using namespace std;
int n;
void solve() {
  for (int i = 3; i >= 0; i--) {
    bool shouldActivateGate = true;
    for (int j = i + 1; j < 4; j++)
      if (!(n & (1 << j))) shouldActivateGate = false;
    if (shouldActivateGate) n ^= (1 << i);
  }
  cout << n << endl;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (cin >> n) solve();
}
