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