n = int(input()) if n>=50: print("000000000000") else: ans = 1 for i in range(2,n+1): ans*=i ans = str(ans) if len(ans)>12: ans = ans[-12:] print(ans)