#include <bits/stdc++.h>
long long int Max(long long int a, long long int b) { return a > b ? a : b; }
long long int gcd(long long int a, long long int b) {
  if (b == 0)
    return a;
  else if (a == 0)
    return b;
  else if (a < b)
    return gcd(a, b % a);
  else
    return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
  return a * b / gcd(a, b);
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    if (n == 1 || n == 2)
      printf("%d\n", n);
    else {
      long long int tmp = lcm(n, n - 1);
      long long int max = 0;
      for (int i = 1; i <= n; i++) {
        max = Max(max, lcm(tmp, i));
      }
      tmp = lcm(n - 2, n - 1);
      for (int i = 1; i <= n - 2; i++) {
        max = Max(max, lcm(tmp, i));
      }
      printf("%I64d\n", max);
    }
  }
}
