#include <bits/stdc++.h>
using namespace std;
unsigned long long int sum;
int main() {
  unsigned long long int i, j, a, b, pos, n;
  scanf("%llu", &n);
  sum = (n - 2) * (n - 2);
  printf("%llu\n", sum);
  return 0;
}
