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