Rank Formula for Cycle Matroids