#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << H;
  debug_out(T...);
}
template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &item) {
  out << '(' << item.first << ", " << item.second << ')';
  return out;
}
template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  for (const auto &item : v) out << item << ' ';
  return out;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n <= 2) return cout << 1 << '\n', 0;
  int a = 4, b = 5;
  while (b < n && a < n) {
    int x = (a % 2 == 0 ? a : b);
    int y = a + b - x;
    a = x + 1 + x;
    b = x + 1 + y;
  }
  if (n == a || n == b)
    cout << 1 << '\n';
  else
    cout << 0 << '\n';
  return 0;
}
