Xiaohong and Xiaoming have a total of 40 apples, and Xiaohong has 6 more apples than Xiaoming. The number of Xiaohua's and Xiaofang's apples combined is exactly twice the number of Xiaohong's apples, and Xiaohua has 4 less apples than Xiaofang. Later, Xiao Hua gave Xiao Ming a few apples, and the two of them had exactly the same number of apples, so how many apples did Xiao Hua give Xiao Ming?
小红和小明一共有40个苹果，小红比小明多6个苹果．小华与小芳的苹果合起来后，恰好是小红苹果数的2倍，其中小华比小芳少4个苹果．后来，小华给了小明几个苹果，他们二人的苹果数恰好相等，那么小华给了小明多少个苹果．
<gadget id="calculator">25 + 21</gadget>
<output>46</output>

<gadget id="calculator">46 / 2</gadget>
<output>23</output>

<gadget id="calculator">25 - 23</gadget>
<output>2</output>

<result>2</result>