#include <bits/stdc++.h>
using namespace std;
const int M = 1000000000 + 7;
const double eps = 1e-7;
inline int cmin(int a, int b) { return a > b ? b : a; }
inline int cmax(int a, int b) { return a > b ? a : b; }
inline int sign(double x) { return (x < -eps) ? -1 : x > eps; }
inline int abs(int n) {
  if (n > 0)
    return n;
  else
    return -n;
}
int main() {
  long long n, ans;
  scanf("%I64d", &n);
  ans = (n - 2) * (n - 2);
  printf("%I64d\n", ans);
  return 0;
}
