#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 10;
long long n, x, y;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  while (x < n) {
    x = (x * 2) + 1 + (x & 1);
    if (x == n or x + 1 == n) return cout << 1, 0;
  }
  cout << 0, 0;
}
