#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); ll N; cin >> N; ll mod = 1000000000000; ll ans = 1; for(ll i = 1; i <= N; i++) { ans *= i % mod; ans %= mod; if(ans == 0) { cout << string(12, '0') << endl; return 0; } } cout << ans << endl; }