#include <iostream>
using namespace std;
int main() {
int n;
cin >> n;
if (n < 3) cout << n;
else cout << (n*(n - 1)*(n - 2));
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IG1haW4oKSB7CglpbnQgbjsKCWNpbiA+PiBuOwoJaWYgKG4gPCAzKSBjb3V0IDw8IG47CgllbHNlIGNvdXQgPDwgKG4qKG4gLSAxKSoobiAtIDIpKTsKCXJldHVybiAwOwp9