N=int(input()) f=0 v=1 MOD=10**12 for i in range(1,min(100,N)+1): v*=i if v>=MOD: v%=MOD f=1 if not f: print(v) else: print('{:0>12}'.format(v))