n=int(input()) ans = 1 for i in range(1, n+1): ans *= i if ans % (1000000000000) == 0: print('000000000000') break else: print(ans%1000000000000)