#include <bits/stdc++.h>
using namespace std;
int main() {
  int x[100005], y[100005];
  int i, n, d = 0, k = 0, cnt = 0;
  cin >> n;
  cin >> x[0] >> y[0];
  d = x[0];
  k = y[0];
  for (i = 1; i <= n; i++) {
    cin >> x[i] >> y[i];
    if (y[i] > y[i - 1]) {
      k = y[i];
    }
  }
  cnt = (n - 4) / 2;
  cout << cnt;
  return 0;
}
