#include <bits/stdc++.h>
using namespace std;
long long a, b, c, e[200000], mix, l, r, o, d[200000];
vector<long long> v[100000], v1;
set<long long> st;
map<long long, long long> mp, mp1;
string s;
pair<int, int> p[100000], p1[100000];
char ch[10];
deque<char> dq;
int main() {
  cin >> a;
  for (int i = 0; i < a / 4; i++)
    if ((a - 2 * (i + 1)) % 2 == 0) c++;
  if (a % 4 == 0) {
    cout << c - 1;
  } else
    cout << c;
}
