#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
signed main() {
  long long n;
  scanf("%lld", &n);
  if (n % 2) {
    cout << "0" << endl;
    return 0;
  }
  long long k = n / 2;
  if (k % 2 == 0) k--;
  cout << k / 2 << endl;
  return 0;
}
