#include <bits/stdc++.h>
using namespace std;
const int maxn = 333333;
const int maxm = 2000000 + 1000;
const int maxt = 3000000 + 100;
const int maxk = 10 + 3;
const long long unit = 1LL;
const int INF = 0x3f3f3f3f;
const long long Inf = 0x3f3f3f3f3f3f3f3fLL;
const double eps = 1e-3;
const double inf = 1e15;
const double pi = acos(-1.0);
const long long mod = 1000000007LL;
inline long long read() {
  long long x = 0;
  bool t = false;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') t = true, ch = getchar();
  while (ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
  return t ? -x : x;
}
int n;
int main() {
  n = read();
  int x = 1;
  while (x <= n) {
    if (n == x || n == x + 1) {
      printf("1\n");
      return 0;
    }
    if (x & 1)
      x = 2 * x + 2;
    else
      x = 2 * x + 1;
  }
  printf("0\n");
  return 0;
}
