A right triangle has legs with lengths x and x+7. If the hypotenuse has a length of x+8, what is the perimeter of the triangle?
24
30
36
40