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