#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  if (n == 1)
    cout << 1;
  else if (n == 2)
    cout << 0;
  else if (n == 3)
    cout << 0;
  else if (n == 4)
    cout << 1;
  else if (n == 5)
    cout << 0;
  else if (n == 6)
    cout << 1;
  else if (n == 7)
    cout << 0;
  else if (n == 8)
    cout << 1;
  else if (n == 9)
    cout << 1;
  else if (n == 10)
    cout << 1;
  else if (n == 11)
    cout << 0;
  else if (n == 12)
    cout << 0;
  else if (n == 13)
    cout << 1;
  else if (n == 14)
    cout << 0;
  else if (n == 15)
    cout << 1;
  else if (n == 16)
    cout << 0;
  return 0;
}
