#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e3 + 5;
int cross(complex<int> a, complex<int> b) { return (conj(a) * b).imag(); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  complex<int> points[MAX];
  for (int i = 0; i <= n; i++) {
    int x, y;
    cin >> x >> y;
    points[i] = {x, y};
  }
  int ans = 0;
  for (int i = 1; i < n; i++)
    ans += cross(points[i] - points[i - 1], points[i + 1] - points[i]) > 0;
  cout << ans << "\n";
}
