<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;
class Solution {
  int a;

 public:
  void run() {
    cin >> a;
    for (int i = 3; i >= 0; --i) {
      bool go = true;
      for (int j = 3; j > i; --j) go &= (a >> j) & 1;
      if (go) a ^= (1 << i);
    }
    cout << a << '\n';
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  Solution().run();
}
