#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
int DET(int xa, int ya, int xb, int yb, int xc, int yc) {
  int d = (xb * yc) + (ya * xc) + (xa * yb) - (ya * xb) - (xa * yc) - (yb * xc);
  return d == 0 ? 0 : d > 0 ? 1 : -1;
}
int main() {
  cout << setprecision(10) << fixed;
  cin.sync_with_stdio(0), cin.tie(0);
  int n;
  cin >> n;
  vector<int> x(2 * n + 2), y(2 * n + 2);
  for (int i = 0; i < n + 1; ++i) {
    cin >> x[i] >> y[i];
    x[n + i - 1] = x[i];
    y[n + i - 1] = y[i];
  }
  int e = 0, d = 0;
  for (int i = 2; i < n + 2; ++i) {
    if (DET(x[i], y[i], x[i - 2], y[i - 2], x[i - 1], y[i - 1]) > 0)
      e++;
    else
      d++;
  }
  if (x[n - 2] > x[0]) {
    cout << e << endl;
  } else
    cout << d << endl;
  return 0;
}
