#include <bits/stdc++.h>
using namespace std;
int main() {
  int a;
  scanf("%d", &a);
  if (a % 2 == 1)
    cout << "0" << endl;
  else {
    a = a / 2;
    if (a % 2 == 0)
      cout << a / 2 - 1 << endl;
    else
      cout << a / 2 << endl;
  }
}
