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