#include <bits/stdc++.h>
using namespace std;
int n, cnt, i = 2;
int main() {
  cin >> n;
  if (n & 1) {
    cout << 0 << endl;
    return 0;
  }
  while (i < n - i) {
    i += 2;
    cnt++;
  }
  cout << cnt << endl;
  return 0;
}
