#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  if (n == 3) cout << "1" << endl;
  if (n == 4) cout << "4" << endl;
  if (n > 4) {
    long long a = ((n - 2) * (n - 2)) / 100000;
    long long b = (n - 2) * (n - 2) % 100000;
    if (a == 0) cout << b << endl;
    if (a > 0) printf("%I64d%05I64d", a, b);
  }
  return 0;
}
