#include <bits/stdc++.h>
using namespace std;
void task();
int main() {
  task();
  return 0;
}
const int N = (int)2e5 + 10;
void task() {
  long long int x;
  cin >> x;
  x = -x;
  x %= 360;
  int ans = 0;
  while (abs(x) > 45 && abs(x) < 315) {
    x = (x + 90) % 360;
    (void(1));
    ;
    ++ans;
  }
  cout << ans;
}
