#include <iostream>
using namespace std;
unsigned long long factorial(int n) {
unsigned long long result = 1;
for (int i = 2; i <= n; i++) {
result *= i;
}
return result;
}
int main() {
int n;
cin >> n;
cout << factorial(n) << endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdW5zaWduZWQgbG9uZyBsb25nIGZhY3RvcmlhbChpbnQgbikgewogICAgdW5zaWduZWQgbG9uZyBsb25nIHJlc3VsdCA9IDE7CiAgICBmb3IgKGludCBpID0gMjsgaSA8PSBuOyBpKyspIHsKICAgICAgICByZXN1bHQgKj0gaTsKICAgIH0KICAgIHJldHVybiByZXN1bHQ7Cn0KCmludCBtYWluKCkgewogICAgaW50IG47CiAgICBjaW4gPj4gbjsKICAgIGNvdXQgPDwgZmFjdG9yaWFsKG4pIDw8IGVuZGw7CiAgICByZXR1cm4gMDsKfQ==