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