#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int x[2000], y[2000], p[2000];
  while (cin >> n) {
    int i, j;
    for (i = 0; i <= n; i++) cin >> x[i] >> y[i];
    int cnt = 0, sum = 0;
    x[n + 1] = x[1];
    y[n + 1] = y[1];
    for (i = 1; i <= n; i++)
      if ((x[i] - x[i - 1]) * (y[i + 1] - y[i]) >
          (y[i] - y[i - 1]) * (x[i + 1] - x[i]))
        cnt++;
      else
        cnt--;
    for (i = 1; i <= n; i++)
      if ((x[i] - x[i - 1]) * (y[i + 1] - y[i]) >
          (y[i] - y[i - 1]) * (x[i + 1] - x[i]))
        sum++;
    cout << sum << endl;
  }
  return 0;
}
