import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner cin = new Scanner(System.in); long N = cin.nextLong(); cin.close(); System.out.println(func(N)); } static long func(long n){ if(n==0L){ return 1; }else{ return (n*func(n-1))%(long)Math.pow(10, 12); } } }