#include <bits/stdc++.h>
using namespace std;
pair<int, int> Vector(pair<int, int> A, pair<int, int> B) {
  return {B.first - A.first, B.second - A.second};
}
int Cross(pair<int, int> A, pair<int, int> B) {
  return A.first * B.second - B.first * A.second;
}
int main() {
  int N, i;
  cin >> N;
  vector<pair<int, int> > A(N);
  for (i = 0; i < N; ++i) cin >> A[i].first >> A[i].second;
  int ans = 0;
  for (i = 1; i < N; ++i) {
    if (Cross(Vector(A[i], A[(i + 1) % N]), Vector(A[i], A[(i - 1)])) > 0)
      ++ans;
  }
  cout << ans;
  return 0;
}
