#include <bits/stdc++.h>
using namespace std;
struct point {
  double x, y;
  point(){};
  point(double a, double b) { x = a, y = b; }
  point operator-(point p) { return point(x - p.x, y - p.y); }
  int operator*(point p) { return x * p.y - y * p.x; }
};
int main() {
  int n, cou = 0;
  cin >> n;
  vector<point> arr(n + 1);
  for (int i = 0; i <= n; i++) cin >> arr[i].x >> arr[i].y;
  for (int i = 1; i <= n - 1; i++) {
    point v1 = arr[i] - arr[i - 1];
    point v2 = arr[i + 1] - arr[i];
    if (v1 * v2 > 0) cou++;
  }
  cout << cou << endl;
  return 0;
}
