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