#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  long double res1, res2 = 1.0 * n / 4;
  res1 = (int)res2;
  int res = res2;
  if (res1 == res2) {
    res--;
  }
  if (n % 2 == 0)
    cout << res << endl;
  else {
    cout << 0 << endl;
  }
  return 0;
}
