#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9 + 7;
const int maxn = 5005;
const int maxm = 200005;
string s = "01001010111001010";
int main() {
  ios_base::sync_with_stdio(false);
  int x;
  cin >> x;
  cout << s[x];
  return 0;
}
