#include <bits/stdc++.h>
using namespace std;
int INF = 2000000000;
long long INFF = 8000000000000000000LL;
double PI = acos(-1);
int dirx[8] = {-1, 0, 0, 1, -1, -1, 1, 1};
int diry[8] = {0, 1, -1, 0, -1, 1, -1, 1};
int main() {
  long long int n;
  cin >> n;
  cout << (n - 2) * (n - 2) << endl;
  return 0;
}
