#include <bits/stdc++.h>
using namespace std;
const int NMAX = 5005;
const int MOD = 1000000007;
const int INF = 100000000;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {-1, 0, 1, 0};
int n;
int main() {
  cin >> n;
  cout << 1LL * 1 + 1LL * 3 * (n - 3) + 1LL * (n - 3) * (n - 4);
  return 0;
}
