#include <bits/stdc++.h>
using namespace std;
long long P = 1000000007;
void solve() {
  long long n;
  cin >> n;
  if (n % 2) {
    cout << 0 << endl;
  } else {
    if (n % 4 == 0) {
      cout << n / 4 - 1 << endl;
    } else {
      cout << n / 4 << endl;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  { solve(); }
  return 0;
}
