#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
long long n;
int main(int argc, char const *argv[]) {
  scanf("%lld", &n);
  n -= 2;
  printf("%lld\n", n * n);
  return 0;
}
