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