#include <bits/stdc++.h>
int main() {
  int n;
  std::cin >> n;
  int x = 1;
  while (x <= n) {
    if (n == x || n == x + 1) {
      std::cout << 1 << '\n';
      return 0;
    }
    if (x % 2 == 0) {
      x = x + 1 + x;
    } else {
      x = (x + 1) + 1 + x;
    }
  }
  std::cout << 0 << '\n';
  return 0;
}
