#include <bits/stdc++.h>
using namespace std;
bool sortinrev(const pair<int, int> &a, const pair<int, int> &b) {
  return (a.first > b.first);
}
struct greaterr {
  template <class T>
  bool operator()(T const &a, T const &b) const {
    return a > b;
  }
};
int main() {
  std::ios::sync_with_stdio(false);
  long long int n;
  cin >> n;
  cout << (n - 2) * (n - 2);
  return 0;
}
