Logic Word Problem w/ Ans.

This one is giving me a hard time :(

In a large high school, some teachers teach only 1 subject, and some teachers teach more than 1 subject. Using the information given in the table below about the math, science, and gym teachers in the school, how many teachers teach math only?

12 taught at least 1 class of math

10 taught at least 1 class of gym

20 taught at least 1 class of science

6 taught both gym and science but not math

5 taught both math and science but not gym

2 taught gym only

1 taught math, gym, and science

The answer is 5 but how??? Can someone help me figure this one out please, is there a way to make a table or something to display what's going on?