#include <bits/stdc++.h>
using namespace std;
const int N = 200007;
int main() {
  ios_base::sync_with_stdio(false);
  long long int n;
  scanf("%lld", &n);
  if (n == 1 || n == 2)
    cout << "0\n";
  else if (n % 2 == 0)
    cout << (n / 2 - 1) << "\n";
  else
    cout << (n / 2) << "\n";
  return 0;
}
