#include <bits/stdc++.h>
int main() {
  int n, i, a, s;
  while (scanf("%d", &n) != EOF) {
    s = 0;
    if (n % 2 != 0)
      printf("0\n");
    else {
      for (i = 1; i <= (n / 4); i++) {
        a = (n - 2 * i) / 2;
        if (i != a) s++;
      }
      printf("%d\n", s);
    }
  }
  return 0;
}
