import math def main(): N = int(input()) if N < 50: ans = math.factorial(N) else: ans = '000000000000' print(str(ans)[-12:]) main()