#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t, n;
  t = 1;
  while (t--) {
    cin >> n;
    if (n % 2 != 0) {
      cout << "0";
      continue;
    }
    long long int p = n / 4;
    if (n % 4 == 0) p--;
    cout << p;
  }
  return 0;
}
