#include <bits/stdc++.h>
using namespace std;
template <int POS, class TUPLE>
void deploy(std::ostream &os, const TUPLE &tuple) {}
template <int POS, class TUPLE, class H, class... Ts>
void deploy(std::ostream &os, const TUPLE &t) {
  os << (POS == 0 ? "" : ", ") << get<POS>(t);
  deploy<POS + 1, TUPLE, Ts...>(os, t);
}
template <class T, class U>
std::ostream &operator<<(std::ostream &os, std::pair<T, U> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::vector<T> &v) {
  int remain = v.size();
  os << "{";
  for (auto e : v) os << e << (--remain == 0 ? "}" : ", ");
  return os;
}
template <class T>
std::ostream &operator<<(std::ostream &os, std::set<T> &v) {
  int remain = v.size();
  os << "{";
  for (auto e : v) os << e << (--remain == 0 ? "}" : ", ");
  return os;
}
template <class T, class K>
std::ostream &operator<<(std::ostream &os, std::map<T, K> &make_pair) {
  int remain = make_pair.size();
  os << "{";
  for (auto e : make_pair)
    os << "(" << e.first << " -> " << e.second << ")"
       << (--remain == 0 ? "}" : ", ");
  return os;
}
using ll = long long;
enum class Dir { U, D, L, R };
Dir prv = Dir::U;
int px, py;
int change(int x, int y) {
  Dir cur;
  int ret = 0;
  if (y == py) {
    if (x < px) {
      cur = Dir::L;
      ret = prv == Dir::U;
    } else {
      cur = Dir::R;
      ret = prv == Dir::D;
    }
  } else {
    if (y > py) {
      cur = Dir::U;
      ret = prv == Dir::R;
    } else {
      cur = Dir::D;
      ret = prv == Dir::L;
    }
  }
  prv = cur;
  return ret;
}
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  int N;
  cin >> N;
  cin >> px >> py;
  int x, y;
  cin >> px >> py;
  int ans = 0;
  for (int i = 2; i < (N); i++) {
    cin >> x >> y;
    ans += change(x, y);
    px = x;
    py = y;
  }
  ans += prv == Dir::L;
  cout << ans << "\n";
  return 0;
}
