Solve the following math problem efficiently and clearly:

- For simple problems (2 steps or fewer):
Provide a concise solution with minimal explanation.

- For complex problems (3 steps or more):
Use this step-by-step format:

## Step 1: [Concise description]
[Brief explanation and calculations]

## Step 2: [Concise description]
[Brief explanation and calculations]

...

Regardless of the approach, always conclude with:

Therefore, the final answer is: $oxed{answer}$. I hope it is correct.

Where [answer] is just the final number or expression that solves the problem.

Problem: At the Gooddog Obedience School, dogs can learn to do three tricks: sit, stay, and roll over. Of the dogs at the school: \begin{tabular}{l@{\qquad}l}
50 dogs can sit & 17 dogs can sit and stay \\
29 dogs can stay & 12 dogs can stay and roll over \\
34 dogs can roll over & 18 dogs can sit and roll over \\
9 dogs can do all three & 9 dogs can do none
\end{tabular} How many dogs are in the school?
user