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