#include <bits/stdc++.h>
using namespace std;
void fast() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  long long int x;
  cin >> x;
  long long int c = 0;
  if (x % 2 != 0)
    c = 0;
  else {
    long long int r = x / 2;
    c = (r - 1) / 2;
  }
  cout << c << "\n";
}
int main() {
  fast();
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
