#include <bits/stdc++.h>
using namespace std;
int a[17];
int main() {
  a[1] = 1;
  a[2] = 0;
  a[3] = 0;
  a[4] = 1;
  a[5] = 0;
  a[6] = 1;
  a[7] = 0;
  a[8] = 1;
  a[9] = 1;
  a[10] = 1;
  a[11] = 0;
  a[12] = 0;
  a[13] = 1;
  a[14] = 0;
  a[15] = 1;
  a[16] = 0;
  int c;
  cin >> c;
  cout << a[c] << endl;
  return 0;
}
