#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0LL)
    return a;
  else
    return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int main() {
  long long n;
  while (scanf("%I64d", &n) != EOF) {
    long long a, res = 0LL;
    int posa, posb, posc;
    if (n - 100LL <= 0LL)
      a = 1LL;
    else
      a = n - 100LL;
    for (long long i = a; i <= n; i++) {
      for (long long j = a; j <= n; j++) {
        for (long long k = a; k <= n; k++) {
          long long x = lcm(k, lcm(i, j));
          res = max(res, x);
        }
      }
    }
    printf("%I64d\n", res);
  }
  return 0;
}
