#include <bits/stdc++.h>
using namespace std;
const double PI = 3.14159265359;
const double EPS = 1e-9;
const long long INF = ((long long)1 << 62);
int main() {
  std::ios::sync_with_stdio(false);
  long long n;
  cin >> n;
  cout << (n - 2) * (n - 2) << endl;
  return 0;
}
