#include <bits/stdc++.h>
using namespace std;
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "RDLU";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "possible" : "impossible");
  exit(0);
}
void addmod(int &x, int y, int mod = 1000000007) {
  x += y;
  if (x >= mod) x -= mod;
}
void et() {
  puts("-1");
  exit(0);
}
int x[1055], y[1055];
int cross(int a, int b, int c, int d) { return a * d - c * b; }
void fmain() {
  scanf("%d", &n);
  for (int(i) = 0; (i) < (int)(n + 1); (i)++) {
    scanf("%d%d", x + i, y + i);
  }
  for (int i = 1; i <= n; i++) {
    int c = cross(x[i] - x[i - 1], y[i] - y[i - 1], x[(i + 1) % n] - x[i - 1],
                  y[(i + 1) % n] - y[i - 1]);
    if (c > 0) k++;
  }
  printf("%d\n", k);
}
int main() {
  fmain();
  return 0;
}
