#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int n, a[100005], s, m;
int main() {
  cin >> n;
  if (n % 2 != 0) {
    cout << 0;
    return 0;
  }
  cout << n / 4 - (n % 4 == 0);
}
