#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <typename T>
T sqr(T x) {
  return x * x;
}
template <typename T>
T cube(T x) {
  return x * x * x;
}
long long nok(long long a, long long b) {
  long long g = gcd(a, b);
  long long t = a / g * b;
  return t;
}
long long NOK(long long a, long long b, long long c) {
  return nok(nok(a, b), c);
}
int main() {
  int n;
  cin >> n;
  if (n == 1) {
    cout << 1 << endl;
    return 0;
  }
  if (n == 2) {
    cout << 2 << endl;
    return 0;
  }
  long long res = -1;
  for (int j = 0; j < 5 && n - j - 2 > 0; j++) {
    long long s = (long long)(n - j) * (n - j - 1);
    for (int i = n - j - 2; i >= 1; i--) {
      long long t = nok(s, i);
      res = max(res, t);
    }
  }
  cout << res << endl;
  return 0;
}
