The total degree of graph G is 18, so graph G has 18/2=9 edges. (The total degree of a graph is twice the number of edges)
Therefore, 4(9-5=4) edges are deleted from G to make it a tree.