#include <bits/stdc++.h>
using namespace std;
template <class T1>
void read(T1 &r_e_a_d);
template <class T1>
void write(T1 w_r_i_t_e);
int main() {
  int qwq;
  read(qwq);
  if (qwq == 1 || qwq == 4 || qwq == 6 || qwq == 8 || qwq == 9 || qwq == 10 ||
      qwq == 13 || qwq == 15) {
    puts("1");
    return 0;
  } else {
    puts("0");
    return 0;
  }
}
template <class T1>
void read(T1 &r_e_a_d) {
  T1 k = 0;
  char ch = getchar();
  int flag = 1;
  while (!(ch >= '0' && ch <= '9')) {
    ch = getchar();
    if (ch == '-') {
      flag = -1;
    }
  }
  while ((ch >= '0' && ch <= '9')) {
    k = (k << 1) + (k << 3) + ch - '0';
    ch = getchar();
  }
  r_e_a_d = flag * k;
}
template <class T1>
void write(T1 w_r_i_t_e) {
  if (w_r_i_t_e < 0) {
    putchar('-');
    write(-w_r_i_t_e);
  } else {
    if (w_r_i_t_e < 10) {
      putchar(w_r_i_t_e + '0');
    } else {
      write(w_r_i_t_e / 10);
      putchar((w_r_i_t_e % 10) + '0');
    }
  }
}
