#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a * b / gcd(a, b); }
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n, ans = 0;
  cin >> n;
  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)
        ans = max(ans, lcm(lcm(i, j), k));
  cout << ans;
  return 0;
}
