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