#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int x = 1;
  for (int dep = 1; x < (int)1e6; ++dep) {
    if (n == x || n == x + 1) {
      printf("1\n");
      return 0;
    }
    x = 2 * x + 1 + (dep & 1);
  }
  printf("0\n");
}
