#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
int n;
struct node {
  int x, y;
} cnt[maxn];
int det(node a, node b, node c) {
  return (a.x - b.x) * (c.y - b.y) - (c.x - b.x) * (a.y - b.y);
}
int main() {
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i <= n; i++) {
      scanf("%d%d", &cnt[i].x, &cnt[i].y);
    }
    cnt[n + 1].x = cnt[1].x;
    cnt[n + 1].y = cnt[1].y;
    int ans = 0;
    for (int i = 1; i <= n; i++) {
      if (det(cnt[i - 1], cnt[i], cnt[i + 1]) < 0) {
        ans++;
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
