#include using namespace std; int main() { int64_t n; cin >> n; if (n >= 50) { puts("000000000000"); return 0; } bool big = false; int64_t ans = 1; for (int i = 1; i <= n; i++) { ans *= i; if (ans >= 1000000000000) big = true; ans %= 1000000000000; } if (big) { printf("%012ld\n", ans); } else { printf("%ld\n", ans); } }