#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  int node = 1;
  while (node <= n) {
    if (n == node || n == node + 1) return cout << 1, 0;
    if (node % 2)
      node = node * 2 + 2;
    else
      node = node * 2 + 1;
  }
  cout << 0;
}
