#include <bits/stdc++.h>
using namespace std;
int cnt = 0;
int main() {
  long long int n, m, p;
  long long int a, b, x, y;
  cin >> n;
  if (n % 2 == 1) return cout << 0 << endl, 0;
  long long int ans = n / 2;
  if (ans % 2 == 1)
    ans /= 2;
  else {
    ans /= 2;
    ans--;
  }
  if (ans < 0) ans = 0;
  cout << ans << endl;
  return 0;
}
