#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long N = 2e5 + 7;
vector<long long> adj[N];
void addEdge(long long x, long long y) {
  adj[x].push_back(y);
  adj[y].push_back(x);
}
long long power(long long x, long long y) {
  long long result = 1;
  while (y) {
    if (y & 1) result = (result * x) % 1000000007;
    x = (x * x) % 1000000007;
    y >>= 1;
  }
  return result;
}
bool isPrime(long long n) {
  bool flag = 1;
  long long i;
  for (i = 2; i <= sqrt(n); ++i) {
    if (n % i == 0) {
      flag = 0;
      break;
    }
  }
  return (flag ? 1 : 0);
}
void testcase() {
  long long n, m, i, j;
  cin >> n;
  cout << (n % 2 == 1 ? n / 2 : n / 2 - 1) << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  while (t--) testcase();
  return 0;
}
