#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n == 2 || n == 3 || n == 5 || n == 7 || n == 11 || n == 12 || n == 14 ||
      n == 16)
    cout << 0 << endl;
  else
    cout << 1 << endl;
}
