#include <bits/stdc++.h>
using namespace std;
long long n, sum;
int main() {
  cin >> n;
  if (n == 3) {
    cout << 1;
    return 0;
  } else {
    sum = (n - 3) * n - (n - 4);
    cout << sum;
  }
  return 0;
}
