#include <bits/stdc++.h>
using namespace std;
bool left(int ld, int d) { return (ld + 1) % 4 == d; }
int get_dir(int lx, int ly, int x, int y) {
  if (lx < x)
    return 3;
  else if (lx > x)
    return 1;
  else if (ly < y)
    return 0;
  else if (ly > y)
    return 2;
}
int main() {
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  int x, y;
  for (int i = 1; i <= n + 1; i++) {
    cin >> x >> y;
    v.push_back({x, y});
  }
  int lx = v[n].first, ly = v[n].second;
  x = v[0].first, y = v[0].second;
  int ld = get_dir(lx, ly, x, y);
  int d;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    lx = x, ly = y;
    x = v[i].first, y = v[i].second;
    d = get_dir(lx, ly, x, y);
    if (left(ld, d)) ans++;
    ld = d;
  }
  cout << ans;
  return 0;
}
