#include #define rep(i,n) for(int i=(0);i<(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; int main(){ cin.tie(0); ios::sync_with_stdio(false); ll n; cin >> n; if(n >= 70){ cout << setfill('0') << right << setw(12); cout << 0 << endl; exit(0); } ll ans = 1; bool over = false; ll bar = 1e12; for(ll i = 1; i <= n; i++){ ans *= i; if(ans >= bar) over = true; ans %= (ll) 1e12; } if(over) cout << setfill('0') << right << setw(12); cout << ans << endl; }