#include using namespace std; const long long MOD = 1000000000000; int main(){ long long N; cin >> N; if (N >= 50){ cout << "000000000000" << endl; } else { long long ans = 1; bool big = false; for (int i = 1; i <= N; i++){ ans *= i; if (ans >= MOD){ big = true; ans %= MOD; } } string S = to_string(ans); if (big){ while (S.size() < 12){ S = '0' + S; } } cout << S << endl; } }