N = int(input()) ans = 1 for i in range(1,N+1): ans = ans * i ans_l = str(ans) print(ans_l[-12:])