def format(n): string = str(n) if len(string) != 12: return ("0"*(12-len(string)) + string) else: return string def main(): N = int(input()) answer = 1 for i in range(1, N+1): answer = (answer * i) % 10**12 if answer == 0: print(format(answer)) return print(answer) main()