#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const double eps = 1e-9;
const int inf = 2000000000;
const long long infLL = 9000000000000000000;
int main() {
  long long n;
  cin >> n;
  long long ans = (n - 2) * (n - 2);
  cout << ans << '\n';
}
