#include <bits/stdc++.h>
using namespace std;
int ccw(int x1, int y1, int x2, int y2, int x3, int y3) {
  int temp = x1 * y2 + x2 * y3 + x3 * y1;
  temp = temp - y1 * x2 - y2 * x3 - y3 * x1;
  if (temp > 0) {
    return 1;
  } else if (temp < 0) {
    return -1;
  } else {
    return 0;
  }
}
struct Node {
  int x, y;
} d[1001];
int main() {
  int n, a = 0, b = 0;
  cin >> n;
  for (int i = 0; i < n + 1; i++) cin >> d[i].x >> d[i].y;
  for (int i = 2; i < n + 1; i++) {
    int ans =
        ccw(d[i - 2].x, d[i - 2].y, d[i - 1].x, d[i - 1].y, d[i].x, d[i].y);
    if (ans == 1)
      a++;
    else if (ans == -1)
      b++;
  }
  cout << min(a, b);
}
