#include <bits/stdc++.h>
using namespace std;
int EAST = -1;
int WEST = -2;
int NORTH = -3;
int SOUTH = -4;
int x[2000], y[2000];
int fetch_dir(int a, int b) {
  if (x[a] == x[b]) {
    if (y[a] > y[b]) return SOUTH;
    return NORTH;
  }
  if (y[a] == y[b]) {
    if (x[a] > x[b]) return WEST;
    return EAST;
  }
  return -1;
}
int fetch_final_direction(int last, int first) {
  int prev_dir = fetch_dir(last, first);
  return prev_dir;
}
int is_danger_turn(int current_dir, int turned_dir,
                   vector<pair<int, int> > danger_turns) {
  for (int i = 0; i < danger_turns.size(); i++) {
    if (danger_turns[i].first == current_dir &&
        danger_turns[i].second == turned_dir)
      return 1;
  }
  return 0;
}
int count_turns(int current, int n, int dir,
                vector<pair<int, int> > danger_turns) {
  if (current >= n - 1) return 0;
  int turned_dir = fetch_dir(current + 1, current + 2);
  if (is_danger_turn(dir, turned_dir, danger_turns))
    return 1 + count_turns(current + 1, n, turned_dir, danger_turns);
  return count_turns(current + 1, n, turned_dir, danger_turns);
}
int main() {
  int i, n;
  vector<pair<int, int> > danger_turns;
  cin >> n;
  for (i = 0; i <= n; i++) {
    cin >> x[i] >> y[i];
  }
  int dir = NORTH;
  int final_dir = fetch_final_direction(n - 1, n);
  if (final_dir == WEST) {
    danger_turns.push_back(make_pair(EAST, NORTH));
    danger_turns.push_back(make_pair(WEST, SOUTH));
    danger_turns.push_back(make_pair(SOUTH, EAST));
    danger_turns.push_back(make_pair(NORTH, WEST));
  } else {
    danger_turns.push_back(make_pair(NORTH, EAST));
    danger_turns.push_back(make_pair(EAST, SOUTH));
    danger_turns.push_back(make_pair(SOUTH, WEST));
    danger_turns.push_back(make_pair(WEST, NORTH));
  }
  int num_danger_turns = count_turns(0, n, NORTH, danger_turns);
  cout << num_danger_turns << endl;
}
