#include <bits/stdc++.h>
using namespace std;
long long int a, b, c, d, e, f, n, m, x, k, l;
long long int arr1[10000001];
long long int summ, subb, divv, timm;
long long int cnt, ans, cnt1, ans1, cnt2, cnt3, cnt4, cnt5;
long double d1, d2, d3, d4, d5;
string s, s1, s2, s3, s4;
string s5 = "ZohidMirzoyev";
char cr[] = {"MirzoyevZohidjon"};
vector<long long int> v, v1, v2;
int main() {
  ;
  ios_base::sync_with_stdio(0);
  cin >> a;
  if (a % 2 != 0) {
    cout << "0" << endl;
    return 0;
  } else {
    ans = a / 4;
    if (a % 4 == 0) ans--;
    cout << ans << endl;
  }
}
