#include using namespace std; typedef long long ll; #define int ll const int mod=1e12; int n,res=1; signed main(){ cin>>n; if(n>=50){ cout<<"000000000000"; return 0; } for(int i=1;i<=n;i++)res=res*i%mod; cout<