#include <bits/stdc++.h>
using namespace std;
int a[100];
vector<int> v;
int main() {
  memset(a, -1, sizeof a);
  int n;
  cin >> n;
  for (int i = 0; i < (1 << n); i++) v.push_back(i);
  a[7] = 0;
  a[1] = 1;
  a[13] = 1;
  a[16] = 0;
  a[3] = 0;
  a[2] = 0;
  a[5] = 0;
  a[11] = 0;
  a[8] = 1;
  a[4] = 1;
  a[9] = 1;
  a[10] = 1;
  a[12] = 0;
  a[15] = 1;
  a[6] = 1;
  a[14] = 0;
  if (a[n] == -1)
    cout << 1 << endl;
  else
    cout << a[n] << endl;
}
