from math import factorial as fact N = int(input()) #50!は10で12回割り切れる。49!は11回。よって、50以上の整数xに対してx!の下12桁は全て0 if N >= 50: print('000000000000') else: print(fact(N) % (10 ** 12))