$%+=$_ for(sort{$a<=>$b}map$a[$_]-$a[$_-1],1..$#a)[<>!~$"..(@a=sort{$a<=>$b}glob<>)-1-$'];print$%