#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
  cin >> n;
  for (int depth = 1; (depth <= n);) {
    if ((n == depth + 1) || (n == depth)) {
      cout << 1;
      return 0;
    }
    depth = depth * 2 + 1 + (depth % 2);
  }
  cout << 0;
  return 0;
}
