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