#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const int inf = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int N = 1e5 + 10;
long long qpow(long long x, long long y, long long MOD) {
  long long a = 1;
  while (y) {
    if (y & 1) a = a * x % MOD;
    x = x * x % MOD;
    y >>= 1;
  }
  return a;
}
int main() {
  int n;
  scanf("%d", &n);
  int x = 1;
  while (x <= n) {
    if (x == n || x + 1 == n) {
      puts("1");
      return 0;
    }
    if (x % 2)
      x = 2 * x + 2;
    else
      x = 2 * x + 1;
  }
  puts("0");
  return 0;
}
