#include <bits/stdc++.h>
using namespace std;
char find_dir(int px, int py, int cx, int cy) {
  if (px == cx) {
    if (py > cy) return 'S';
    return 'N';
  } else {
    if (px > cx) return 'W';
    return 'E';
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  int px, py, cx, cy, fx, fy, ans = 0;
  char cur_dir, fut_dir;
  cin >> px >> py >> cx >> cy;
  cur_dir = find_dir(px, py, cx, cy);
  for (int i = 0; i < n - 1; i++) {
    px = cx;
    py = cy;
    cin >> cx >> cy;
    fut_dir = find_dir(px, py, cx, cy);
    if (cur_dir == 'E' && fut_dir == 'N' || cur_dir == 'N' && fut_dir == 'W')
      ans++;
    if (cur_dir == 'S' && fut_dir == 'E' || cur_dir == 'W' && fut_dir == 'S')
      ans++;
    cur_dir = fut_dir;
  }
  cout << ans << "\n";
  return 0;
}
