Relationship between number of triangles and perimeter