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