Graph theory: determining maximum number of edges
The following identity is well-known:
$$
2|E| = \sum_{v \in V} d(v).
$$
In words, if we sum all degrees in a graph, we get twice the number of edges. To see this, divide each edge $(x,y)$ into two halves: the $x$-half and the $y$-half. We think of the $x$-half as a half-edge labeled $x$. The left-hand side counts the number of half-edges. On the right-hand side, $d(v)$ counts the number of half-edges labeled $v$, and so in total, the right-hand side also counts the number of half-edges.

If the graph has maximum degree $\Delta$ (in your case, $\Delta = 5$) then
$$
2|E| = \sum_{v \in V} d(v) \leq \sum_{v \in V} \Delta = \Delta |V|,
$$
and so $|E| \leq (\Delta/2) |V|$; there is equality if the graph is $\Delta$-regular (all degrees are exactly $\Delta$).