find an expression for the number of edges of line graph L(G) in terms of degree of vertices of graph (G)

This is a nice question on Geometry How can solve it ?