x=int(input()) for i in range (1,x): x*=i print(x%1000000000000)