Determining the Number of Triangles and Solving