while 1:r=raw_input().split("!");print reduce(int.__mul__,range(int(r[0]),0,1-len(r)))