Calculating length for all selected lines