#include <bits/stdc++.h>
using namespace std;
const long long mod = (long long)1e9 + 7;
const long long maxn = (long long)5e4 + 5;
const int nnn = 1048590;
const int inf = numeric_limits<int>::max() - 1;
const long long INF = numeric_limits<long long>::max() - 1;
long long dx[] = {0, 1, 0, -1};
long long dy[] = {1, 0, -1, 0};
long long dxx[] = {0, 1, 0, -1, 1, 1, -1, -1};
long long dyy[] = {1, 0, -1, 0, 1, -1, 1, -1};
void solve() {
  long long n;
  cin >> n;
  if (n % 2) {
    cout << "0";
    return;
  }
  cout << max(0ll, ((n / 2) - 1) / 2);
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  long long T;
  T = 1;
  while (T--) {
    solve();
  }
  return 0;
}
