#include <bits/stdc++.h>
using namespace std;
long long nok(long long a, long long b) {
  long long nok;
  long long d = a * b;
  while ((a != 0) && (b != 0)) {
    if (a > b) {
      a = a % b;
    } else if (b >= a) {
      b = b % a;
    }
  }
  nok = d / (a + b);
  return nok;
}
int main() {
  long long n, i, j, k, y, r = 0;
  long long NOK3NUM;
  cin >> n;
  if (n <= 50) {
    y = 1;
  } else {
    y = n - 50;
  }
  for (i = n; i >= y; i--) {
    for (j = n; j >= y; j--) {
      for (k = n; k >= y; k--) {
        NOK3NUM = nok(i, j);
        NOK3NUM = nok(NOK3NUM, k);
        r = max(NOK3NUM, r);
      }
    }
  }
  cout << r;
  return 0;
}
