#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
const int N = 2e5;
vector<int> g[N];
int a[N];
int mpow(int base, int exp);
void ipgraph(int n, int m);
void dfs(int u, int par);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int i, n;
  cin >> n;
  long long ans = 1 - n;
  ans += (n - 2) * 3;
  ans += (n - 3) * 1LL * (n - 3);
  cout << ans << endl;
  return 0;
}
int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((long long)result * base) % mod;
    base = ((long long)base * base) % mod;
    exp >>= 1;
  }
  return result;
}
void ipgraph(int n, int m) {
  int i, u, v;
  while (m--) {
    cin >> u >> v;
    g[u - 1].push_back(v - 1);
    g[v - 1].push_back(u - 1);
  }
}
void dfs(int u, int par) {
  for (int v : g[u]) {
    if (v == par) continue;
    dfs(v, u);
  }
}
