#include <bits/stdc++.h>
using namespace std;
int n, x = 1;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  while (x <= n) {
    if (n == x || n == x + 1) {
      cout << "1\n";
      return 0;
    }
    x = x + 1 + x + (x & 1);
  }
  cout << "0\n";
  return 0;
}
