#include <bits/stdc++.h>
using namespace std;
struct PT {
 public:
  long long x, y;
  PT(int _x, int _y) {
    x = _x;
    y = _y;
  }
  PT() {
    x = 0;
    y = 0;
  }
  bool operator<(const PT &p) const { return x < p.x || (x == p.x && y < p.y); }
  bool operator==(const PT &p) const { return (x == p.x && y == p.y); }
};
long long cross(const PT &O, const PT &A, const PT &B) {
  return (A.x - O.x) * (B.y - O.y) - (A.y - O.y) * (B.x - O.x);
}
int main() {
  int n, x, y;
  vector<PT> ve;
  scanf("%d", &(n));
  for (int i = 0; i < n; i++) {
    scanf("%d", &(x));
    scanf("%d", &(y));
    ve.push_back(PT(x, y));
  }
  int result = 0;
  for (int i = 1; i < ve.size() - 1; i++) {
    if (cross(ve[i], ve[i - 1], ve[i + 1]) < 0ll) result++;
  }
  printf("%d\n", result);
  return 0;
}
