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