#include <bits/stdc++.h>
using namespace std;
string s = "1001010111001010";
inline int read() {
  char c = getchar();
  int num = 0;
  bool b = 0;
  for (; c < '0' || c > '9'; b = (c == '-' ? 1 : 0), c = getchar())
    ;
  for (; c >= '0' && c <= '9';
       num = (num << 3) + (num << 1) + (c ^ '0'), c = getchar())
    ;
  return b ? -num : num;
}
int main() {
  cout << s[read() - 1];
  return 0;
}
