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