#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
const int mod = 1000000007;
const double pi = acos(-1);
int main() {
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  if (n == 3) return cout << 1, 0;
  long long tmp = n - 2;
  cout << tmp * tmp;
}
