#include <bits/stdc++.h>
using namespace std;
int n;
string s = "01001010111001010";
inline int read() {
  int f = 1, x = 0;
  char s = getchar();
  while (s < '0' || s > '9') {
    if (s == '-') f = -1;
    s = getchar();
  }
  while (s >= '0' && s <= '9') {
    x = x * 10 + s - '0';
    s = getchar();
  }
  return x * f;
}
int main() {
  n = read();
  cout << s[n] << endl;
  return 0;
}
