#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int b = n - 2;
  long long ans = (long long)(n - 2) * (n - 2);
  if (n == 3)
    cout << 1;
  else
    cout << ans;
  return 0;
}
