from functools import reduce N = int(input()) two,five = 0,0 if N >= 50: print('0'*12) else: print(reduce(lambda x,y : x * y,[i for i in range(N,0,-1)])%(10**12))