def main(): N = int(input()) if N < 50: j = 1 for i in range(1, N+1): j = j * i else: j = '000000000000' print(str(j)[-12:]) main()