#include <bits/stdc++.h>
using namespace std;
int n, ans = 0;
inline bool check(int x0, int y0, int x1, int y1) {
  return x0 * y1 - y0 * x1 > 0;
}
int main() {
  scanf("%d", &n);
  int x0, y0, x1, y1, x2, y2;
  scanf("%d%d%d%d", &x0, &y0, &x1, &y1);
  for (int i = 2; i <= n; i++) {
    scanf("%d%d", &x2, &y2);
    ans += check(x1 - x0, y1 - y0, x2 - x1, y2 - y1);
    x0 = x1, y0 = y1;
    x1 = x2, y1 = y2;
  }
  printf("%d\n", ans);
  return 0;
}
