#include <bits/stdc++.h>
int main() {
  unsigned long long n;
  std::cin >> n;
  unsigned long long out = 2 * n - 5;
  if (n == 3) {
    std::cout << 1 << std::endl;
    return 0;
  }
  if (n % 2 == 0) {
    std::cout << (out + 1) * (n - 2) / 2;
  } else {
    std::cout << (out + 1) * ((n - 2) / 2) + (n - 2) << std::endl;
  }
  return 0;
}
