#include <bits/stdc++.h>
using namespace std;
int main() {
  int index;
  int answer[16] = {1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0};
  cin >> index;
  cout << answer[index - 1];
  return 0;
}
