#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
const int mod = 1000000007;
const double pi = 3.1415926536;
const int mmax = 1e6 + 5;
void swap(int& a, int& b) {
  a = a ^ b;
  b = b ^ a;
  a = a ^ b;
}
int rime(int n) {
  if (n == 1) return 0;
  if (n != 2 && n % 2 == 0) return 0;
  for (int i = 3; i * i <= n; i += 2) {
    if (n % i == 0) return 0;
  }
  return 1;
}
const int size_of_sieve = 1e6 + 5;
vector<bool> prime(size_of_sieve + 1, true);
void sv(int n) {
  prime[0] = prime[1] = false;
  for (int i = 2; i * i <= n; i++) {
    if (prime[i]) {
      for (int j = i * i; j <= n; j += i) {
        prime[j] = false;
      }
    }
  }
}
void print_prime(int n) {
  for (int i = 2; i <= n; i++) {
    if (prime[i]) cout << i << " ";
  }
}
int isprime(int n) { return prime[n]; }
int modu(int a, int b) { return ((a % b + b) % b); }
int power(int a, int b) {
  int res = 1;
  while (b > 0) {
    if (b & 1) res *= a;
    a *= a;
    b = b >> 1;
  }
  return res;
}
int gcd(int a, int b) {
  int m = a % b;
  if (m == 0) return b;
  return gcd(b, m);
}
int lcm(int a, int b) { return (a / gcd(a, b)) * b; }
void solve() {
  int n;
  cin >> n;
  if (n & 1) {
    cout << 0;
  } else {
    int d = n / 4;
    if (n % 4 == 0) d--;
    cout << d;
  }
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  for (int i = 0; i < t; i++) {
    solve();
  }
  return 0;
}
