<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 main() {
  ios_base::sync_with_stdio(false);
  int n, k;
  cin >> n;
  int tof[4] = {n & 0b1000, n & 0b0100, n & 0b0010, n & 0b0001};
  tof[0] = !tof[0];
  if (tof[0]) tof[1] = !tof[1];
  if (tof[0] && tof[1]) tof[2] = !tof[2];
  if (tof[0] && tof[1] && tof[2]) tof[3] = !tof[3];
  cout << (tof[0] ? 8 : 0) + (tof[1] ? 4 : 0) + (tof[2] ? 2 : 0) +
              (tof[3] ? 1 : 0);
  return 0;
}
