#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000111;
int n;
int main() {
  scanf("%d", &n);
  if (n % 2 == 1) {
    printf("0\n");
    return 0;
  }
  n /= 2;
  printf("%d\n", (n - 1) / 2);
  return 0;
}
