#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    long long int ans = 0;
    ans = (long long int)(n - 2) * (n - 2);
    printf("%I64d\n", ans);
  }
  return 0;
}
