#include <bits/stdc++.h>
using namespace std;
int dx[] = {+1, -1, +0, +0};
int dy[] = {+0, +0, +1, -1};
int KingX[] = {+0, +0, +1, -1, -1, +1, -1, +1};
int KingY[] = {-1, +1, +0, +0, +1, +1, -1, -1};
int KnightX[] = {-2, -2, -1, -1, 1, 1, 2, 2};
int KnightY[] = {-1, 1, -2, 2, -2, 2, -1, 1};
template <class T>
inline T bigmod(T b, T p, T M) {
  T ret = 1;
  for (; p > 0; p >>= 1) {
    if (p & 1) ret = (ret * b) % M;
    b = (b * b) % M;
  }
  return (T)ret;
}
template <class T>
inline T modinverse(T a, T M) {
  return bigmod(a, M - 2, M);
}
template <class T>
inline T gcd(T a, T b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  return a * b / gcd<T>(a, b);
}
template <class T>
inline T power(T b, T p) {
  unsigned long long int x = 1;
  while (p--) x *= b;
  return x;
}
const long long int mod = 1000000007;
struct point {
  int x, y;
  point() {}
  point(int x, int y) {
    this->x = x;
    this->y = y;
  }
  void input() {
    int xx, yy;
    scanf("%d %d", &xx, &yy);
    x = xx;
    y = yy;
  }
};
long long int triArea_includesSign(point a, point b, point c) {
  long long int ret = 0;
  ret += (a.x * b.y) - (b.x * a.y);
  ret += (b.x * c.y) - (c.x * b.y);
  ret += (c.x * a.y) - (a.x * c.y);
  return ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ;
  int n;
  scanf("%d", &n);
  point arr[n + 5];
  for (int i = 0; i < n + 1; i++) {
    arr[i].input();
  }
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    long long int area = triArea_includesSign(arr[i - 1], arr[i], arr[i + 1]);
    if (area > 0) cnt++;
  }
  printf("%d\n", cnt);
  return 0;
}
