#include using namespace std; using ll = long long; map memo; ll f(ll n){ if(memo.find(n) != memo.end()) return memo[n]; if(n<=1) return memo[n] = 1; else return memo[n] = (n*f(n-1))%1000000000000; } int main(){ ll n; cin >> n; if(n<=50) cout << f(n) << endl; else cout << 0 << endl; return 0; }