#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, c = 0;
  cin >> n;
  if (n % 2 == 0) {
    if ((n / 2) % 2 == 1)
      n = (n / 2) + 1;
    else
      n = n / 2;
    for (int i = 1, j = n - 1; i <= n / 2; i++, j--) {
      if (i != j) c++;
    }
  }
  cout << c << endl;
  return 0;
}
