#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > v;
int n, licz;
void read() {
  scanf("%d", &n);
  int a, b;
  for (int i = 0; i <= n; i++) {
    scanf("%d%d", &a, &b);
    v.push_back(make_pair(a, b));
  }
  v.push_back(v[1]);
}
bool check(pair<int, int> a, pair<int, int> b, pair<int, int> c) {
  b.first -= a.first;
  b.second -= a.second;
  c.first -= a.first;
  c.second -= a.second;
  if (b.first * c.second - b.second * c.first > 0)
    return true;
  else
    return false;
}
void solve() {
  read();
  for (int i = 2; i < v.size(); i++)
    if (check(v[i - 2], v[i - 1], v[i])) licz++;
  printf("%d", licz);
}
int main() {
  solve();
  return 0;
}
