#include <bits/stdc++.h>
using namespace std;
long long a[200000], t[5000012], l = 0, r, m, n;
int k, s1, s2, s3, s4, s5, s6, s7, s8, p;
string s;
int main() {
  cin >> n;
  if (n % 4 == 0)
    cout << n / 4 - 1;
  else if (n % 4 == 2)
    cout << n / 4;
  else
    cout << 0;
  return 0;
}
