<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;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  if (n == 0)
    n = 15;
  else if (n == 1)
    n = 14;
  else if (n <= 3)
    n += 10;
  else if (n <= 7)
    n += 4;
  else
    n -= 8;
  cout << n;
}
