#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, count = 0, i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    if (i == 1)
      count += n - 2;
    else if (i == 2 || i == n)
      count += n - 3;
    else
      count += n - 4;
  }
  cout << count << endl;
  return 0;
}
