#include <bits/stdc++.h>
using namespace std;
long long solve() {
  long long n;
  cin >> n;
  n -= 2;
  return (n * n);
}
int main() {
  int t;
  t = 1;
  while (t--) {
    cout << solve() << '\n';
  }
}
