#include <bits/stdc++.h>
using namespace std;
inline void R(int &x) {
  char ch = getchar();
  x = 0;
  for (; ch < '0'; ch = getchar())
    ;
  for (; ch >= '0'; ch = getchar()) x = x * 10 + ch - '0';
}
const int N = 100005;
int num[17] = {8848, 958, 12766, 6695,  1100,   807,    31962, 146,
               20,   25,  134,   10000, 663268, 154103, 1642,  106};
int n, ans[65] = {0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0};
int main() {
  scanf("%d", &n);
  printf("%d\n", ans[n]);
  return 0;
}
