#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int n, n1;
  cin >> n;
  n1 = n / 4;
  if (n1 * 4 == n) n1--;
  if (n % 2 == 1) n1 = 0;
  cout << n1 << endl;
  return 0;
}
