<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>
struct IO {
  template <typename T>
  inline friend IO operator>>(IO in, T &x) {
    x = 0;
    int f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
      if (ch == '-') f = -1;
      ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
      x = x * 10 + (ch ^ 48);
      ch = getchar();
    }
    x *= f;
    return in;
  }
  template <typename T>
  inline friend IO operator<<(IO in, T x) {
    if (x < 0) x = -x, putchar('-');
    static T sta[35];
    T top = 0;
    do {
      sta[top++] = x % 10, x /= 10;
    } while (x);
    while (top) putchar(sta[--top] + '0');
    return in;
  }
} cin, cout;
int s[100] = {15, 14, 12, 13, 8, 9, 10, 11, 0, 1, 2, 3, 4, 5, 6, 7};
int main() {
  int n;
  cin >> n;
  cout << s[n];
  return 0;
}
