import java.util.Scanner; public class Main{ static final Scanner s=new Scanner(System.in); public static void main(String[] __){ long res=1,n=s.nextLong(); boolean f=false; for(int i=2;i<=n&&res!=0;i++) { res*=i; f|=res>1000000000000L; res%=1000000000000L; } System.out.printf(f?"%012d\n":"%d\n",res); } }