#include <bits/stdc++.h>
using namespace std;
const int MAX = 100005;
const int oo = 1e9 + 7;
const long long mod = 1e9 + 7;
const double eps = 1e-11;
long long n;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  cout << (n - 2LL) * (n - 2LL) << endl;
}
