#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1.01e9;
const long long infll = (long long)1.01e18;
const long double eps = 1e-9;
const long double pi = acos((long double)-1);
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count());
int rnd(int x) { return mrand() % x; }
const int maxn = (int)1e6 + 5;
vector<int> ans;
void precalc() {
  ans.push_back(1);
  ans.push_back(2);
  int x = 4, y = 5;
  while (x < maxn) {
    ans.push_back(min(x, y));
    ans.push_back(max(x, y));
    int ny = 2 * x + 1, nx = x + y + 1;
    x = nx;
    y = ny;
  }
}
int n;
bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  return true;
}
void solve() {
  int pos = lower_bound(ans.begin(), ans.end(), n) - ans.begin();
  if (pos >= ((int)(ans).size()) || ans[pos] != n) {
    printf("0\n");
    return;
  }
  printf("1\n");
}
int main() {
  precalc();
  while (read()) {
    solve();
  }
  return 0;
}
