#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<pair<long long, long long> > lines;
  for (int i = 0; i < n; i++) {
    long long x, y;
    cin >> x >> y;
    lines.push_back(make_pair(x, y));
  }
  lines.push_back(lines[0]);
  lines.push_back(lines[1]);
  int ans = 0;
  for (int i = 0; i < n; i++) {
    long long vec1x = lines[i + 1].first - lines[i].first;
    long long vec1y = lines[i + 1].second - lines[i].second;
    long long vec2x = lines[i + 2].first - lines[i + 1].first;
    long long vec2y = lines[i + 2].second - lines[i + 1].second;
    if (vec1x * vec2y - vec1y * vec2x > 0) {
      ans++;
    }
  }
  cout << ans;
}
