import java.util.*; class Main{ public static void main(String args[]){ Scanner cin = new Scanner(System.in); long target = cin.nextLong(); long res = func(target); int size = String.valueOf(res).length(); if(size>12){ res = (long)(res/Math.pow(10,size-1)); } System.out.println(res); } static long func(long num){ if(num==0){ return 1; } return num*func(num-1); } }