#include <bits/stdc++.h>
using namespace std;
const long long INF = (long long)2e18;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  vector<long long> x(n + 2), y(n + 2);
  for (long long i = 0; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  x[n + 1] = x[0];
  y[n + 1] = y[0];
  long long cnt = 0;
  for (long long i = 1; i < (n + 1); i++) {
    long long nxt = (i + 1);
    if (x[i] == x[i - 1]) {
      if ((y[i] - y[i - 1]) > 0 && (x[nxt] - x[i]) < 0)
        cnt++;
      else if ((y[i] - y[i - 1]) < 0 && (x[nxt] - x[i]) > 0)
        cnt++;
    } else {
      if ((x[i] - x[i - 1]) > 0 && (y[nxt] - y[i]) > 0)
        cnt++;
      else if ((x[i] - x[i - 1]) < 0 && (y[nxt] - y[i]) < 0)
        cnt++;
    }
  }
  cout << cnt;
}
