Let $n$ be the number of sides of the polygon. The number of diagonals of a polygon with $n$ sides is given by the formula $\frac{n(n-3)}{2}$. 
We are given that $n - \frac{n(n-3)}{2} = 0$. 
Multiplying both sides by 2 gives $2n - n(n-3) = 0$. 
Expanding the equation gives $2n - n^2 + 3n = 0$. 
Combining like terms gives $5n - n^2 = 0$. 
Factoring out an $n$ gives $n(5 - n) = 0$. 
Setting each factor equal to zero gives $n = 0$ or $n = 5$. 
Since a polygon cannot have zero sides, the number of sides of the polygon is $\boxed{5}$.The answer is: 5
Below is a math problem. Provide a detailed, step-by-step solution.

### Problem:
If the number of diagonals of a regular polygon is subtracted from the number of sides of the polygon, the result is zero. What is the number of sides of this polygon?

### Answer:
