#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  if (n % 2 == 1)
    printf("0\n");
  else {
    int sum = 0;
    int temp = n / 2;
    if (temp % 2 == 0)
      sum = temp / 2 - 1;
    else
      sum = temp / 2;
    printf("%d\n", sum);
  }
  return 0;
}
