#include <bits/stdc++.h>
using namespace std;
int n, m;
pair<int, int> v[300111];
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  int dir = 0;
  for (int i = 0; i < n + 1; i++) {
    cin >> v[i].first >> v[i].second;
  }
  for (int i = 0; i < n; i++) v[i + n] = v[i];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    pair<int, int> A = pair<int, int>(v[i + 1].first - v[i].first,
                                      v[i + 1].second - v[i].second);
    pair<int, int> B = pair<int, int>(v[i + 2].first - v[i + 1].first,
                                      v[i + 2].second - v[i + 1].second);
    int dot = A.first * B.second - A.second * B.first;
    if (dot > 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
