Quick question about an array

how do i go about adding the values of array items together? basically i have an array of randomly sized rectangle sprites and i want to find their total length (as if they were lined up end to end)