#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1000;
int score1 = 0, score2 = 0;
int a[MaxN], b[MaxN];
int x;
int main() {
  cin >> x;
  if (x == 1) cout << 1;
  if (x == 2) cout << 0;
  if (x == 3) cout << 0;
  if (x == 4) cout << 1;
  if (x == 5) cout << 0;
  if (x == 6) cout << 1;
  if (x == 7) cout << 0;
  if (x == 8) cout << 1;
  if (x == 9) cout << 1;
  if (x == 10) cout << 1;
  if (x == 11) cout << 0;
  if (x == 12) cout << 0;
  if (x == 13) cout << 1;
  if (x == 14) cout << 0;
  if (x == 15) cout << 1;
  if (x == 16) cout << 0;
}
