#include <bits/stdc++.h>
using namespace std;
int x[5000010], y[5000010], n, i, ans;
int cross(int a, int b, int c) {
  return (x[a] - x[c]) * (y[b] - y[c]) - (x[b] - x[c]) * (y[a] - y[c]);
}
int main() {
  scanf("%d", &n);
  for (i = 0; i <= n; i++) scanf("%d%d", &x[i], &y[i]);
  for (i = 2; i <= n; i++)
    if (cross(i, i - 2, i - 1) > 0) ans++;
  printf("%d\n", ans);
}
