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