#include <bits/stdc++.h>
using namespace std;
const int maxN = 10001;
vector<pair<int, int> > v, pts;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    pts.push_back(make_pair(x, y));
  }
  for (int i = 0; i < n - 1; i++) {
    v.push_back(make_pair(pts[(i + 1) % n].first - pts[i].first,
                          pts[(i + 1) % n].second - pts[i].second));
  }
  int res = 0;
  for (int i = 0; i < v.size() - 1; i++) {
    int vmul = v[i].first * v[i + 1].second - v[i + 1].first * v[i].second;
    if (vmul > 0) {
      res++;
    }
  }
  cout << res;
  return 0;
}
