f = 1 N = int( input() ) N = min( N, 100 ) for i in range( 1, N + 1, 1 ): f *= i print( f % int( 1e12 ) )