#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, s;
  cin >> n;
  if (n % 2 != 0)
    cout << "0";
  else {
    s = n / 4;
    if ((n / 4) * 4 == n) s -= 1;
    cout << s;
  }
  return 0;
}
