#include <bits/stdc++.h>
using namespace std;
long long dp[26];
set<long long> se;
signed main() {
  dp[1] = 1;
  se.insert(1);
  for (long long i = 2; i <= 25; i++) {
    dp[i] = 2 * dp[i - 1] + 1 + (i % 2 == 0);
    se.insert(dp[i]);
  }
  long long n;
  cin >> n;
  cout << (se.count(n) || se.count(n - 1)) << endl;
}
