#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9, mod = 1e9 + 7, N = 100009;
int n;
long long cnt;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  cout << 1LL * (n - 2) * (n - 2) << "\n";
}
