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