import math N = int(input()) if N >= 50: print('000000000000') else: f = math.factorial(N) print(str(f)[-12:] if f >= 10 ** 12 else f)