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