#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned int n;
  cin >> n;
  if ((n <= 4) || (n & 1)) {
    cout << 0 << endl;
  } else {
    n /= 2;
    if (n & 1) {
      cout << (n / 2) << endl;
    } else
      cout << (n / 2 - 1) << endl;
  }
  return 0;
}
