#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    if (n % 2 == 1)
      printf("0\n");
    else {
      int a, r, l, ans = 0;
      a = n / 2;
      l = a - 1;
      r = 1;
      while (l > r) {
        ans++;
        l--;
        r++;
      }
      printf("%d\n", ans);
    }
  }
  return 0;
}
