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