#include <bits/stdc++.h>
using namespace std;
string s, y;
int winner(string a, string b) {
  if (a == b) return 0;
  if (a == "8<" && b == "[]") return -1;
  if (a == "[]" && b == "8<") return 1;
  if (a == "8<" && b == "()") return 1;
  if (a == "()" && b == "8<") return -1;
  if (a == "()" && b == "[]") return 1;
  if (a == "[]" && b == "()") return -1;
}
int arr[124] = {0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0};
int main() {
  int u, i, j(0);
  cin >> i;
  cout << arr[i];
  return 0;
}
