#include <bits/stdc++.h>
using namespace std;
const int MAXN = -1;
const int INF = 2000000010;
const long long INFLL = 999999999999999999ll;
int main() {
  int n;
  scanf("%d", &n);
  printf("%lld\n", 1ll * (n - 2) * (n - 2));
  return 0;
}
