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