<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;
template <typename Tp>
inline void outarr(Tp _begin, Tp _end, const char* _delim = " ") {
  for (Tp current = _begin; current != _end; ++current) {
    std::cout << *current << _delim;
  }
  std::cout << '\n';
}
using ll = int64_t;
using pii = std::pair<int, int>;
constexpr int INF = 0x3f3f3f3f;
constexpr int MOD = static_cast<const int>(1e9 + 7);
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  int n;
  cin >> n;
  n ^= 8;
  for (int i = 2; i >= 0; --i) {
    bool fl = true;
    for (int j = 3; j > i; --j) {
      if ((n & (1 << j)) == 0) {
        fl = false;
        break;
      }
    }
    if (fl) {
      n ^= 1 << i;
    }
  }
  cout << n << "\n";
  return 0;
}
