#include <bits/stdc++.h>
using namespace std;
const int Nmax = 1001;
int N;
int Pos, Neg;
int X[Nmax], Y[Nmax];
double CP(int a, int b, int m, int n, int x, int y) {
  return (((double(m) - a) * (double(y) - b)) -
          ((double(x) - a) * (double(n) - b)));
}
int main() {
  cin >> N;
  for (int i = 1; i <= N; ++i) cin >> X[i] >> Y[i];
  for (int i = 3; i <= N; ++i)
    if (CP(X[i - 2], Y[i - 2], X[i - 1], Y[i - 1], X[i], Y[i]) < 0)
      Neg++;
    else
      Pos++;
  if (CP(X[N], Y[N], X[1], Y[1], X[2], Y[2]) < 0)
    Neg++;
  else
    Pos++;
  if (CP(X[N - 1], Y[N - 1], X[N], Y[N], X[1], Y[1]) < 0)
    Neg++;
  else
    Pos++;
  cout << min(Pos, Neg);
}
