#include <bits/stdc++.h>
using namespace std;
const long long N = 200005;
long long n;
bool check[N] = {0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0};
int main() {
  cin >> n;
  cout << check[n] << endl;
  return 0;
}
