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