#include <bits/stdc++.h>
using namespace std;
int n;
vector<long long> x, y;
inline long long vp(long long x1, long long y1, long long x2, long long y2) {
  return x1 * y2 - y1 * x2;
}
int main() {
  std::ios::sync_with_stdio(false);
  cin >> n;
  x.resize(n + 1);
  y.resize(n + 1);
  for (int i = 0; i < n; ++i) {
    cin >> x[i] >> y[i];
  }
  x[n] = x[0];
  y[n] = y[0];
  int ans = 0;
  for (int i = 0; i < n - 1; ++i) {
    ans += int(vp(x[i + 1] - x[i], y[i + 1] - y[i], x[i + 2] - x[i],
                  y[i + 2] - y[i]) > 0);
  }
  cout << ans;
  return 0;
}
