#include <bits/stdc++.h>
using namespace std;
const long long N = 1001;
const long long mod = 100000007;
const long long M = 100005;
const double eps = 1e-10;
const double pi = acos(-1);
template <class T>
void splitstr(const string &second, vector<T> &out) {
  istringstream in(second);
  out.clear();
  copy(istream_iterator<T>(in), istream_iterator<T>(), back_inserter(out));
}
template <typename T>
static T __gcd(T a, T b) {
  return b ? __gcd(b, a % b) : a;
}
template <typename T>
static T inverse(T a, T m) {
  a = mod(a, m);
  if (a <= 1) return a;
  return mod((1 - inverse(m, a) * m) / a, m);
}
long long Read;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> Read;
  if (Read == 1 || Read == 13 || Read == 8 || Read == 9 || Read == 10 ||
      Read == 15 || Read == 4 || Read == 6)
    cout << 1;
  else
    cout << 0;
  return 0;
}
