import math print(math.factorial(int(input()))%10**12)