#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  long long ans = 3 * (n - 3) + 1 + (n - 3) * (n - 4);
  cout << ans << endl;
  return 0;
}
inline int nextInt() {
  int x = 0;
  char c = getchar();
  while ((c < '0' || c > '9')) c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x;
}
