#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
const int inf = 0x3f3f3f3f;
int main() {
  int n;
  scanf("%d", &n);
  int ans = 1;
  while (ans <= n) {
    if (ans == n || ans + 1 == n) {
      printf("1\n");
      return 0;
    }
    if (ans & 1)
      ans += ans + 2;
    else
      ans += ans + 1;
  }
  printf("0\n");
  return 0;
}
