#include <bits/stdc++.h>
using namespace std;
long long gcd(long long A, long long B) {
  if (A < B) return gcd(B, A);
  if (B == 0) return A;
  return gcd(B, A % B);
}
long long lcm(long long A, long long B) {
  long long Tmp = gcd(A, B);
  return ((A / Tmp) * B);
}
int main() {
  ios::sync_with_stdio(false);
  long long N;
  cin >> N;
  long long MX = 1;
  for (long long i = max(1LL, N - 100); i <= N; i++)
    for (long long j = max(1LL, N - 100); j <= N; j++)
      for (long long k = max(1LL, N - 100); k <= N; k++) {
        long long Tmp = lcm(i, j);
        MX = max(MX, lcm(Tmp, k));
      }
  cout << MX << endl;
  return 0;
}
