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