#include<iostream>
using namespace std;
int fact(int n)
{
if(n==0) return 1;
int ans=n*fact(n-1);
return ans;
}
int main()
{
int n;
cin>>n;
int ans=fact(n);
cout<<ans<<endl;
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgZmFjdChpbnQgbikKewogICAgaWYobj09MCkgcmV0dXJuIDE7CiAgICBpbnQgYW5zPW4qZmFjdChuLTEpOwogICAgcmV0dXJuIGFuczsKfQppbnQgbWFpbigpCnsKICAgIGludCBuOwogICAgY2luPj5uOwogICAgaW50IGFucz1mYWN0KG4pOwogICAgY291dDw8YW5zPDxlbmRsOwogICAgcmV0dXJuIDA7Cn0=