#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, x = 0;
  scanf("%d", &n);
  for (i = 2; i <= n / 2; i += 2) {
    if ((n - i) % 2 == 0 && i / 2 != (n - i) / 2) x++;
  }
  printf("%d\n", x);
}
