#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long> > hull;
int main() {
  int a, b, i, j, n, count;
  map<pair<long long, long long>, int> mapping;
  scanf("%d", &n);
  for (i = 0; i < n + 1; i++) {
    scanf("%d %d", &a, &b);
    hull.push_back(pair<long long, long long>(a, b));
  }
  hull.push_back(hull[1]);
  count = 0;
  for (i = 0; i < n; i++) {
    if (hull[i + 1].second == hull[i].second &&
        hull[i + 2].first == hull[i + 1].first &&
        (hull[i + 1].first - hull[i].first) *
                (hull[i + 1].second - hull[i + 2].second) <
            0) {
      count++;
    }
    if (hull[i + 1].first == hull[i].first &&
        hull[i + 2].second == hull[i + 1].second &&
        (hull[i + 1].second - hull[i].second) *
                (hull[i + 1].first - hull[i + 2].first) >
            0) {
      count++;
    }
  }
  cout << count;
  return 0;
}
