#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<pair<int, int>> v(n);
  for (int i = 0; i < n; ++i) cin >> v[i].first >> v[i].second;
  int lr, rr;
  lr = rr = 0;
  for (int i = 0; i < n; ++i) {
    int i1 = i, i2 = (i + 1) % n, i3 = (i + 2) % n;
    int xx1 = v[i2].first - v[i1].first;
    int yy1 = v[i2].second - v[i1].second;
    int xx2 = v[i3].first - v[i2].first;
    int yy2 = v[i3].second - v[i2].second;
    int vp = xx1 * yy2 - xx2 * yy1;
    if (vp < 0)
      ++lr;
    else
      ++rr;
  }
  cout << min(lr, rr);
  return 0;
}
