certain class of students participated in the physical examination, among which 20 students were excellent in the 100 meters, 18 were excellent in the long jump, 7 were excellent in both the 100 meters and the long jump, 6 were excellent in the high jump and the 100 meters, and both were excellent in the high jump and long jump. There were 8 excellent students, 22 excellent students in the high jump, 5 students in the class who were excellent in all three events, and only 1 student who was not excellent in all items. Looking for the number of people in the class?
某班同学参加体育测试，其中百米得优着20人，跳远得优者18人，又知百米、跳远都得优者7人，跳高、百米得优者6人，跳高、跳远均得优者8人，跳高得优者22人，全班三项都是优秀的有5人，只有1名同学各项都没达优秀．求全班人数？
<gadget id="calculator">22 - 7 - 6 - 8</gadget>
<output>1</output>

<gadget id="calculator">20 + 18 + 1 + 5 + 1</gadget>
<output>45</output>

<result>45</result>