In a regular polygon, the number of diagonals is equal to three times the number of sides minus 30. How many sides does the polygon have? Let's think step by step and output the final answer within \boxed{}.
user