According to Mr. Li’s statistics, 40 students like to play badminton and table tennis. Everyone likes at least one of them. There are 24 people who like to play badminton and 22 people who like to play table tennis. How many people like both?
李老师统计40位同学喜欢打羽毛球和乒乓球的情况，每个人至少喜欢其中一种，有24人喜欢打羽毛球，22人喜欢打乒乓球，两种球都喜欢的有多少人？
<gadget id="calculator">22 - 40</gadget>
<output>-18</output>

<gadget id="calculator">24 + (-18)</gadget>
<output>6</output>

<result>6</result>