System.in.eachLine{m=i=1 println it[-1..0]*.toLong().sum{m*=i;it*m/i++}}