#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n;
  cin >> n;
  if (n % 2 == 1) {
    printf("0\n");
    return 0;
  }
  long long cnt = n / 4;
  if (n % 4 == 0) cnt--;
  cout << cnt << endl;
  return 0;
}
