Count triangles in a pentagon with all of its diagonals drawn How many triangles in this picture? 

I am able to count one by one, but it takes long time. I wonder whether there is an easy way or systematic way to count. Thank you.

Ordering the $10$ vertices from top to bottom, and in rows left-to-right, the adjacency matrix of this graph is
$$\left(
\begin{array}{cccccccccc}
 0 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 1 & 1 \\
 1 & 0 & 1 & 1 & 1 & 1 & 0 & 1 & 1 & 1 \\
 1 & 1 & 0 & 1 & 1 & 1 & 0 & 0 & 1 & 0 \\
 1 & 1 & 1 & 0 & 1 & 0 & 1 & 0 & 0 & 1 \\
 1 & 1 & 1 & 1 & 0 & 0 & 1 & 1 & 1 & 1 \\
 1 & 1 & 1 & 0 & 0 & 0 & 0 & 1 & 1 & 1 \\
 1 & 0 & 0 & 1 & 1 & 0 & 0 & 1 & 1 & 1 \\
 0 & 1 & 0 & 0 & 1 & 1 & 1 & 0 & 1 & 1 \\
 1 & 1 & 1 & 0 & 1 & 1 & 1 & 1 & 0 & 1 \\
 1 & 1 & 0 & 1 & 1 & 1 & 1 & 1 & 1 & 0 \\
\end{array}
\right)$$
The trace of the third power of this matrix is $330$, and this counts the triangles in the graph, each six times, giving $55$ triangles But this also counts triangles whose vertices are collinear. This happens when all three vertices are on the same one of the five sides of the “star.” Each star side contains four vertices, so there are ${4\choose3}=4$ such triangles on each of the five star sides. Subtracting these $4\times5=20$ degenerate triangles from the $55$ triangles in the graph leaves $35$ triangles.
