#include <bits/stdc++.h>
using namespace std;
int main() {
  long long x;
  cin >> x;
  x = (-x) % 360;
  int ans;
  long long mn1 = (long long)8e18;
  for (int i = 0; i < 228; i++) {
    long long T = abs((x + 90 * i) % 360);
    T = min(T, 360 - T);
    if (T < mn1) mn1 = T, ans = i;
  }
  cout << ans << endl;
  return 0;
}
