How to calculate the total length of multiple lines

How to calculate the total length of multiple, polilines or rectangle ?