#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  if (n % 2 == 0 && n > 4) {
    int k = 0, c = 1, x = (n - (c * 2)) / 2;
    while (c < x) {
      k++;
      c++;
      x = ((n - (c * 2)) / 2);
    }
    cout << k << endl;
  } else {
    cout << "0" << endl;
  }
  return 0;
}
