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