#!ruby -n i=chomp.unpack'U*' b=700 a=72 d=-1 $><<:-if 0455 a+=36*z/z+=38 d=0)}while i[h]?d-=(~N+N=i.sort[h])*~h-1:puts