n = int(input()) if n >= 50: print("0" * 12) else: val = 1 for i in range(n, 1, -1): val *= i val = str(val) print(val[-12:])