File standardInput readLines map(v,v=v split map(asNumber)sort;((1+m:=v at(0))*m*(1-m+3*v last)/6)println)