#include <bits/stdc++.h>
using namespace std;
struct Point {
  long long x, y;
  Point() : x(0), y(0) {}
  Point(long long x, long long y) : x(x), y(y) {}
  Point operator-(Point op) const { return Point(x - op.x, y - op.y); }
  Point operator+(Point op) const { return Point(x + op.x, y + op.y); }
  Point operator*(long long op) const { return Point(x * op, y * op); }
  long long operator*(Point op) const { return x * op.x + y * op.y; }
  long long operator%(Point op) const { return x * op.y - y * op.x; }
  long long length2() { return x * x + y * y; }
  double length() { return sqrt(length2()); }
};
Point nextPoint() {
  int x, y;
  cin >> x >> y;
  return Point(x, y);
}
const int MAX_N = 1e6 + 10;
Point a[MAX_N];
int check(Point& x, Point& y, Point& z) {
  Point a = y - x;
  Point b = z - y;
  return a % b > 0 ? 1 : 0;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < (n); ++i) a[i] = nextPoint();
  int res = 0;
  for (int i = 0; i < (n); ++i) {
    if (i < 2) continue;
    res += check(a[i - 2], a[i - 1], a[i]);
  }
  cout << res << endl;
  return 0;
}
