#include <bits/stdc++.h>
using namespace std;
int main() {
  long long i, n, e, r;
  cin >> n;
  e = n;
  e += 2 * n - 6;
  for (i = 3; i < n; i++) {
    e += n - 3;
  }
  r = e - n + 1;
  cout << r << "\n";
  return 0;
}
