#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
long long n;
int main() {
  cin >> n;
  if (n == 1) {
    cout << 0;
    return 0;
  }
  cout << n / 2 - 1 + (n % 2 != 0);
  return 0;
}
