answer = 1 target = int(input()) if target >= 50: print("000000000000") else: for n in range(1,target + 1): answer *= n print(answer % 1000000000000)