#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 1;
const double PI = acos(-1);
struct point {
  int x, y;
  point(int a, int b) {
    x = a;
    y = b;
  }
  inline double len() { return sqrt((x * x) + (y * y)); }
  inline void prnt() { printf("%d %d\n", x, y); }
};
inline int operator^(const point& a, const point& b) {
  return a.x * b.y - b.x * a.y;
}
inline point operator-(const point& b, const point& a) {
  return point(a.x - b.x, a.y - b.y);
}
inline point operator+(const point& a, const point& b) {
  return point(a.x + b.x, a.y + b.y);
}
inline int calc(const point& a, const point& b) {
  return (a.x * b.x) - (a.y * b.y);
}
int main() {
  int n;
  vector<point> v;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int a, b;
    scanf("%d%d", &a, &b);
    v.push_back(point(a, b));
  }
  int an = 0;
  for (int i = 0; i < n - 2; ++i) {
    point A = v[i];
    point B = v[i + 1];
    point C = v[i + 2];
    point VectorA = B - A;
    point VectorB = C - B;
    if ((VectorA ^ VectorB) >= 1) ++an;
  }
  printf("%d\n", an);
}
