<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 T>
std::string toString(T val) {
  std::ostringstream oss;
  oss << val;
  return oss.str();
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const pair<T, U> &_p) {
  _out << _p.first << ' ' << _p.second << '\n';
  return _out;
}
template <typename T, typename U>
inline istream &operator>>(istream &_in, pair<T, U> &_p) {
  _in >> _p.first >> _p.second;
  return _in;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const vector<T> &_v) {
  if (_v.empty()) {
    return _out;
  }
  _out << _v.front() << ' ';
  for (auto _it = ++_v.begin(); _it != _v.end(); ++_it) {
    _out << *_it << ' ';
  }
  return _out;
}
template <typename T>
inline istream &operator>>(istream &_in, vector<T> &_v) {
  for (auto &_i : _v) {
    _in >> _i;
  }
  return _in;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const set<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const multiset<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const unordered_set<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T>
inline ostream &operator<<(ostream &_out, const unordered_multiset<T> &_s) {
  if (_s.empty()) {
    return _out;
  }
  _out << *_s.begin();
  for (auto _it = ++_s.begin(); _it != _s.end(); ++_it) {
    _out << ' ' << *_it;
  }
  return _out;
}
template <typename T, typename U>
inline ostream &operator<<(ostream &_out, const map<T, U> &_m) {
  if (_m.empty()) {
    return _out;
  }
  for (auto _it : _m) {
    _out << _it.first << ": " << _it.second << '\n';
  }
  return _out;
}
vector<long long> dx = {1, -1, 0, 0};
vector<long long> dy = {0, 0, 1, -1};
struct cord {
  long long x, y;
  string s;
  long long h;
};
const long long mod = 1e9 + 7;
vector<long long> zfun(string s) {
  long long n = s.size();
  vector<long long> z(n, 0);
  for (long long i = 1, l = 0, r = 0; i < n; i++) {
    if (i <= r) z[i] = min(r - i + 1, z[i - l]);
    while (i + z[i] < n && s[z[i]] == s[i + z[i]]) z[i]++;
    if (i + z[i] - 1 > r) l = i, r = i + z[i] - 1;
  }
  return z;
}
long long bin_pow(long long base, long long p) {
  if (p == 1) {
    return base;
  }
  if (p % 2 == 0) {
    long long t = bin_pow(base, p / 2);
    return t * t % mod;
  } else {
    return bin_pow(base, p - 1) * base % mod;
  }
}
long long inverse_element(long long x) { return bin_pow(x, mod - 2); }
long long divide(long long a, long long b) {
  return a * inverse_element(b) % mod;
}
bool can(vector<long long> &a, long long l, long long r) {
  long long last = a[l];
  for (long long i = l + 1; i <= r; i++) {
    if (last <= a[i]) {
      last = a[i];
    } else {
      return 0;
    }
  }
  return 1;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  if (n == 3) {
    cout << 13;
  }
  if (n == 0) {
    cout << 15;
  }
  if (n == 2) {
    cout << 12;
  }
  if (n == 1) {
    cout << 14;
  }
  if (n == 4) {
    cout << 8;
  }
  if (n == 5) {
    cout << 9;
  }
  if (n == 6) {
    cout << 10;
  }
  if (n == 7) {
    cout << 11;
  }
  if (n == 8) {
    cout << 0;
  }
  if (n == 9) {
    cout << 1;
  }
  if (n == 10) {
    cout << 2;
  }
  if (n == 11) {
    cout << 3;
  }
  if (n == 12) {
    cout << 4;
  }
  if (n == 13) {
    cout << 5;
  }
  if (n == 14) {
    cout << 6;
  }
  if (n == 15) {
    cout << 7;
  }
}
