#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  switch (n) {
    case 7:
      cout << 0;
      break;
    case 5:
      cout << 0;
      break;
    case 11:
      cout << 0;
      break;
    case 16:
      cout << 0;
      break;
    case 12:
      cout << 0;
      break;
    case 3:
      cout << 0;
      break;
    case 2:
      cout << 0;
      break;
    case 14:
      cout << 0;
      break;
    default:
      cout << 1;
  }
  return 0;
}
