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