Calculate total wire length