#include <bits/stdc++.h>
using namespace std;
struct vec {
  int x, y;
  vec(int _x, int _y) {
    x = _x;
    y = _y;
  }
};
int n, x[1005], y[1005], sign;
int cross(vec v1, vec v2) { return v1.x * v2.y - v2.x * v1.y; }
int main(void) {
  cin >> n;
  cin >> x[0] >> y[0];
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i];
  sign = cross(vec(x[1] - x[0], y[1] - y[0]), vec(x[2] - x[1], y[2] - y[1]));
  int nega = 0, posi = 0;
  for (int i = 1; i <= n - 1; i++) {
    vec v1 = vec(x[i] - x[i - 1], y[i] - y[i - 1]);
    vec v2 = vec(x[i + 1] - x[i], y[i + 1] - y[i]);
    int temp = cross(v1, v2);
    if (temp < 0)
      nega++;
    else
      posi++;
  }
  cout << min(nega, posi) << endl;
}
