#include <bits/stdc++.h>
int main() {
  int x;
  scanf("%d", &x);
  if (x == 2 || x == 3 || x == 5 || x == 7 || x == 11 || x == 12 || x == 14 ||
      x == 16) {
    printf("0");
  } else {
    printf("1");
  }
  return 0;
}
