#include <bits/stdc++.h>
using namespace std;
vector<pair<int, pair<int, int> > > v;
int main() {
  ios_base::sync_with_stdio(false);
  ;
  int n;
  cin >> n;
  cout << (long long)(n - 2) * (n - 2);
  return 0;
}
