#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")
using namespace std;
vector<long long> zeus(long long n) {
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  return a;
}
void Shazam() {
  long long n;
  cin >> n;
  if (n % 2 != 0) {
    cout << 0 << "\n";
    return;
  }
  long long ans = n / 4;
  if (n % 4 == 0) {
    cout << ans - 1 << "\n";
  } else {
    cout << ans << "\n";
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long t = 1;
  while (t--) {
    Shazam();
  }
  return 0;
}
