#include <bits/stdc++.h>
using namespace std;
int x[1010], y[1010];
int lef(int x1, int y1, int x2, int y2) {
  if (x1) x1 = (x1 > 0 ? 1 : -1);
  if (y1) y1 = (y1 > 0 ? 1 : -1);
  if (x2) x2 = (x2 > 0 ? 1 : -1);
  if (y2) y2 = (y2 > 0 ? 1 : -1);
  if (x1 == 0 && y1 == 1) {
    if (x2 == 1)
      return 0;
    else
      return 1;
  }
  if (x1 == 0 && y1 == -1) {
    if (x2 == 1)
      return 1;
    else
      return 0;
  }
  return lef(-x2, -y2, -x1, -y1) > 0 ? 0 : 1;
}
int main() {
  int n, i, num1, num2;
  while (cin >> n) {
    for (i = 0; i <= n; i++) {
      scanf("%d %d", &x[i], &y[i]);
    }
    x[n + 1] = x[1];
    y[n + 1] = y[1];
    num1 = num2 = 0;
    for (i = 1; i <= n; i++) {
      if (lef((x[i] - x[i - 1]), (y[i] - y[i - 1]), (x[i + 1] - x[i]),
              (y[i + 1] - y[i])))
        num1++;
      else
        num2++;
    }
    cout << min(num1, num2) << endl;
  }
}
