my $n = 0; $n += map .5*(1+length)*length, $s =~ /\d+/g;