#include <bits/stdc++.h>
using namespace std;
long long n, t = 1;
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 3; i < n; i++) {
    t += n - 4;
  }
  t += 3 * (n - 3);
  cout << t << "\n";
  return 0;
}
