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