#include <bits/stdc++.h>
inline void read(int &x) {
  int i = 1;
  x = 0;
  char a = getchar();
  while (a < '0' || a > '9') {
    if (a == '-') i = -1;
    a = getchar();
  }
  while (a >= '0' && a <= '9') {
    x = x * 10 + a - 48;
    a = getchar();
  }
  x *= i;
}
inline void write(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x > 9) write(x / 10);
  putchar(x % 10 + 48);
}
char s[] = "1001010111001010";
int main() {
  int n;
  read(n);
  putchar(s[n - 1]);
  return 0;
}
