#include <bits/stdc++.h>
int main() {
  long long n, ans;
  scanf("%I64d", &n);
  ans = 3 * n - 8;
  for (long long i = 1; i <= n - 3; i++) {
    ans += n - 4;
  }
  printf("%I64d\n", ans);
  return 0;
}
