#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, x = 4, y = 5;
  scanf("%d", &n);
  if (n == 1 || n == 2) {
    cout << 1;
    return 0;
  }
  while (y < n) {
    if (x & 1)
      x = 2 * y, y = x + 1;
    else
      x = 2 * y - 1, y = x + 1;
  }
  printf("%d", (x == n || y == n));
  return 0;
}
