package yukicoder; import java.util.Scanner; public class N500 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); long N=sc.nextLong(); long ans =1; for(int i=2;i<=N;i++) { ans*=i; ans%=(long)Math.pow(10, 12); } System.out.println(ans); } }