#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > vec;
int main() {
  int num, a, b, count = 0, n;
  cin >> num;
  for (int i = 0; i <= num; i++) {
    cin >> a >> b;
    vec.push_back(make_pair(a, b));
  }
  for (int i = 0; i < num; i++) {
    int c, ne, p;
    c = i;
    ne = (i + 1) % num;
    p = (i - 1) % num;
    if (p < 0) p += num;
    int x1 = vec[ne].first - vec[c].first;
    int y1 = vec[ne].second - vec[c].second;
    int x2 = vec[c].first - vec[p].first;
    int y2 = vec[c].second - vec[p].second;
    int temp = -x1 * y2 + x2 * y1;
    if (temp > 0) {
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
