System.in.eachLine{i=f=-1 a=it.split()[i..0]*.toLong() n=a.size() println a.sum{it*=f=f*n--/i--}}