#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, ans = 0;
  cin >> n;
  n = (n % 360 + 360) % 360;
  for (int i = 1; i < 4; i++)
    if (abs(n - 90 * i) < abs(n - 90 * ans)) ans = i;
  if (n >= 360 - 45) ans = 0;
  cout << ans << endl;
  return 0;
}
