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