#include <bits/stdc++.h>
using namespace std;
const unsigned long long int N = 4e5 + 5;
const unsigned long long int mod = 1e9 + 9;
int main() {
  ios::sync_with_stdio(false);
  unsigned long long int n;
  cin >> n;
  cout << (unsigned long long int)pow(n - 2, 2) << endl;
  return 0;
}
