#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n;
  cin >> n;
  ;
  cout << (n - 2) * (n - 2);
}
int32_t main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  int q;
  q = 1;
  while (q--) {
    solve();
    cout << endl;
  }
  return 0;
}
