#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize(3)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target("sse3", "sse2", "sse")
#pragma GCC target("avx", "sse4", "sse4.1", "sse4.2", "ssse3")
#pragma GCC target("f16c")
#pragma GCC optimize("inline", "fast-math", "unroll-loops", \
                     "no-stack-protector")
using namespace std;
const int N = 1010;
const int M = 1e6;
const int INF = 0x3f3f3f3f;
const int MOD = 1000000007;
string str[N];
string str1[3] = {"A", "B", "C"};
string str2[3] = {"AB", "AC", "BC"};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  cout << (long long)(n - 2) * (n - 2) << endl;
  return 0;
}
