#include <bits/stdc++.h>
using namespace std;
int main() {
  unsigned long long int n, t, p;
  cin >> n;
  p = n / 4;
  if (n % 2 != 0) {
    cout << "0";
    return 0;
  } else if (n % 4 == 0)
    t = (n / 4) - 1;
  else {
    t = n / 4;
  }
  cout << t;
}
