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