LOCALi : positive_integer;n : positive_integer := swsrh.segments;td : positive_length_measure := swsrh.segment_depths[1];END_LOCAL;IF n = 1 THEN RETURN(td);ELSE REPEAT i := 2 TO n; td := td + swsrh.segment_depths[i]; END_REPEAT;END_IF;RETURN(td);