#include <bits/stdc++.h>
using namespace std;
const int N = 5e5 + 5;
const long long mod = 1e9 + 7;
int dp[2 * N];
int main() {
  int n = 1;
  while (n < 2 * N) {
    dp[n] = dp[n + 1] = 1;
    n = n * 2 + 1 + (n % 2);
  }
  cin >> n;
  cout << dp[n];
  return 0;
}
