#include <bits/stdc++.h>
using namespace std;
int main() {
  int i;
  cin >> i;
  if (i == 1 || i == 4 || i == 6 || i == 8 || i == 9 || i == 10 || i == 13 ||
      i == 15)
    cout << 1 << endl;
  else
    cout << 0 << endl;
}
