Measuring chain

Dear All ,

I want to use chain length into equation, how to get total length of chain any idea , or i have to measure line by line,

SolidworksGeneral