#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e8;
const double PI = 4 * atan(1);
set<char> vowel = {'A', 'O', 'Y', 'E', 'U', 'I', 'a', 'o', 'y', 'e', 'u', 'i'};
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, 1, -1, -1};
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long lcm(long long a, long long b) { return a * (b / gcd(a, b)); }
bool issquare(long long w) { return trunc(sqrt(w)) * trunc(sqrt(w)) == w; }
bool isprime(long long u) {
  for (long long i = 2; i <= (int)sqrt(u); i++) {
    if (u % i == 0) return 0;
  }
  return 1;
}
long long mod(long long to_mod) {
  to_mod %= MOD;
  while (to_mod < 0) to_mod += MOD;
  return to_mod % MOD;
}
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long _sieve_size;
bitset<5000005> bs;
vector<long long> primes;
void sieve(long long upperbound) {
  _sieve_size = upperbound + 1;
  bs.set();
  bs[0] = bs[1] = 0;
  for (long long i = 2; i <= _sieve_size; i++)
    if (bs[i]) {
      for (long long j = i * i; j <= _sieve_size; j += i) bs[j] = 0;
      primes.push_back(i);
    }
}
long long n, m, k, a, l, r, b, t, ans = 0, res = 0, x, y, z, xmax, xmin;
vector<long long> vv, v;
double db;
vector<vector<long long> > vvv;
map<long long, vector<long long> > adj;
char c;
bool check = true;
map<long long, long long> maa, maaa;
string ch, ch1, ch2;
unordered_set<long long> ss;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  if (n < 0) {
    n *= -1;
    n %= 360;
  } else {
    n %= 360;
    n *= -1;
  }
  if (abs(n) >= 180) {
    if (n > 0)
      n = -(360 - n);
    else
      n = 360 + n;
  }
  ans = 0;
  res = 5000;
  m = n;
  for (int i = 0; i <= 4; i++) {
    n = m + 90 * i;
    if (abs(n) < res || abs(360 - n) < res) {
      res = min(abs(n), abs(360 - n));
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
