#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n == 3) {
    cout << 1 << endl;
  } else {
    cout << n * 1ll * (n - 2) - n - (n - 4) << endl;
  }
  return 0;
}
