# Counting vertices of a tree

I was told a tree has non-leaf vertices with degrees $5,5,5,8,10$, and I was told to calculate how many total vertices there are.

I thought to draw the tree in three levels - top one is a choice of a root, middle one is other non-leaf vertices and remaining leaves, and lowest one is the remaining leaves.

Then we assign "corrected degrees" telling us how many vertices are below each vertex. This leaves the root fixed and lowers all other degrees by $1$. So if we start with non-leaf vertices $v_1,\dots ,v_n$, the result should be $(\sum_{i=1}^n\deg v_i)-(n-1)$. Is this correct?

HINT: Suppose that there are $n$ leaves. Then the sum of the degrees of the vertices is $33+n$, and there are $n+5$ vertices altogether. Use the handshaking lemma and the fact that a tree has one more vertex than it has edges to solve for $n$.