#include <bits/stdc++.h>
using namespace std;
long long n, sol, i;
int main() {
  cin >> n;
  if (n == 3) cout << 1;
  if (n == 4) cout << 4;
  if (n == 5) cout << 9;
  if (n == 6) cout << 16;
  if (n >= 7) {
    sol = 2 + (n - 4) * (n - 2) + 2 * (n - 3);
    cout << sol;
  }
  return 0;
}
