#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const int N = 1e5 + 5;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int n;
  cin >> n;
  long long int brstr = 0;
  brstr += (n - 3) * (n - 4);
  brstr += 3 * (n - 3);
  cout << brstr + 1 << "\n";
}
