#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n % 2 == 1 || n < 6)
    printf("0\n");
  else {
    int a, b, c, d, ck = 0;
    a = 1, b = 1;
    c = (n - 2) / 2;
    d = (n - 2) / 2;
    while (a < c) {
      ck++;
      a++, c--;
    }
    printf("%d\n", ck);
  }
  return 0;
}
