n = int(input()) res = 1 if n >= 60: res = "0" * 12 else: for i in range(1, n + 1): res *= i if len(str(res)) > 6: res = int(str(res)[-12:]) print(str(res)[-12:])