#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 5;
pair<int, int> a[N];
int crossproduct(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  pair<int, int> d = pair<int, int>(b.first - a.first, b.second - a.second);
  pair<int, int> e = pair<int, int>(c.first - b.first, c.second - b.second);
  return (d.first * e.second - e.first * d.second);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  int first, second;
  cin >> first >> second;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (crossproduct(a[i], a[(i + 1) % n], a[(i + 2) % n]) > 0) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
