#include <bits/stdc++.h>
using namespace std;
complex<long long> p[1010];
int n, a, b, z;
inline int compare(long long a, long long b) {
  return a < b ? -1 : (a > b ? 1 : 0);
}
inline int next(int a) { return a < n ? a + 1 : 0; }
inline int prev(int a) { return a > 0 ? a - 1 : n - 1; }
inline bool x(int i, int j) {
  bool z = p[i].real() != p[i + 1].real();
  bool zz = p[j].real() != p[j + 1].real();
  if (z == zz) {
    if (z && p[i].imag() == p[j].imag()) {
      bool right = p[i + 1].real() > p[i].real();
      return ((right && p[i].real() < max(p[j].real(), p[j + 1].real())) ||
              (!right && p[i].real() > min(p[j].real(), p[j + 1].real()))) &&
             (compare(p[i].imag(), p[prev(j)].imag()) ==
              -compare(p[i].imag(), p[next(j + 1)].imag()));
    } else if (!z && p[i].real() == p[j].real()) {
      bool up = p[i + 1].imag() > p[i].imag();
      return ((up && p[i].imag() < max(p[j].imag(), p[j + 1].imag())) ||
              (!up && p[i].imag() > min(p[j].imag(), p[j + 1].imag()))) &&
             (compare(p[i].real(), p[prev(j)].real()) ==
              -compare(p[i].real(), p[next(j + 1)].real()));
    } else
      return 0;
  }
  if (z == zz) return 0;
  if (z) {
    bool right = p[i + 1].real() > p[i].real();
    int mix = min(p[i].real(), p[i + 1].real()),
        maks = max(p[i].real(), p[i + 1].real());
    int miy = min(p[j].imag(), p[j + 1].imag()),
        may = max(p[j].imag(), p[j + 1].imag());
    return (!right || mix < p[j].real()) && (right || maks > p[j].real()) &&
           miy < p[i].imag() && may > p[i].imag();
  } else {
    bool up = p[i + 1].imag() > p[i].imag();
    int mix = min(p[j].real(), p[j + 1].real()),
        maks = max(p[j].real(), p[j + 1].real());
    int miy = min(p[i].imag(), p[i + 1].imag()),
        may = max(p[i].imag(), p[i + 1].imag());
    return mix < p[i].real() && maks > p[i].real() &&
           (!up || miy < p[j].imag()) && (up || may > p[j].imag());
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie();
  cin >> n;
  for (int i = 0; i <= n; i++) {
    cin >> a >> b;
    p[i] = {a, b};
  }
  for (int i = 0; i < n; i++) {
    int y = 0;
    for (int j = 0; j < n; j++)
      if (i != j) {
        bool zz = x(i, j);
        y += zz;
      }
    if (y & 1) z++;
  }
  cout << z << endl;
}
