#include <bits/stdc++.h>
using namespace std;
bool compare(int i, int j) { return i > j; }
int main() {
  long long n, res;
  bool mark[100][100];
  cin >> n;
  res = 1;
  res = 1 + (n - 3) * (n - 1);
  cout << res << endl;
  return 0;
}
