#include <bits/stdc++.h>
int main() {
  long n, a, b, sum = 0;
  scanf("%ld", &n);
  a = 1;
  b = n / 2 - 1;
  if (n % 2 == 0) {
    while (a < b) {
      sum++;
      a++;
      b--;
    }
  }
  printf("%ld\n", sum);
  return 0;
}
