#include <bits/stdc++.h>
using namespace std;
const int MAXN = 11234;
struct Point {
  long long x, y;
  Point() {}
  Point(long long _x, long long _y) {
    x = _x;
    y = _y;
  }
  Point operator-(const Point &o) { return Point(x - o.x, y - o.y); }
  long long operator^(const Point &o) { return x * o.y - y * o.x; }
};
int n;
Point points[MAXN];
int main() {
  cin >> n;
  for (int i = 0; i <= n; i++) {
    cin >> points[i].x >> points[i].y;
  }
  points[n + 1] = points[1];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    if (((points[i + 1] - points[i]) ^ (points[i + 2] - points[i])) > 0LL)
      ans++;
  }
  cout << ans << endl;
}
