#include <bits/stdc++.h>
using namespace std;
enum Direction { North, South, East, West };
int main() {
  int n;
  cin >> n;
  int x0, y0, x, y;
  cin >> x0 >> y0;
  cin >> x0 >> y0;
  Direction curr_dir = North;
  Direction new_dir = North;
  long long count = 0;
  for (int i = 2; i < n; i++) {
    cin >> x >> y;
    if (x == x0) {
      if (y > y0) {
        new_dir = North;
      } else {
        new_dir = South;
      }
    } else {
      if (x > x0) {
        new_dir = East;
      } else {
        new_dir = West;
      }
    }
    if ((curr_dir == East && new_dir == North) ||
        (curr_dir == North && new_dir == West) ||
        (curr_dir == South && new_dir == East) ||
        (curr_dir == West && new_dir == South)) {
      count++;
    }
    x0 = x;
    y0 = y;
    curr_dir = new_dir;
  }
  cout << count << endl;
  return 0;
}
