#include <bits/stdc++.h>
using namespace std;
const int MAX_BUF_SIZE = 16384;
char BUFOR[MAX_BUF_SIZE];
int BUF_SIZE, BUF_POS;
char ZZZ;
const int MXN = 1000010;
const int C = 262144;
const int INF = 1000000001;
void test() {
  int n;
  scanf("%d", &n);
  cout << ((long long int)(n - 1) * (n - 3) + 1) << endl;
}
int main() {
  int te = 1;
  while (te--) test();
  return 0;
}
