In Fred the Farmer's barn, there were 100 horses, 29 sheep, and 9 chickens. Brian bought half of the animals and sold them at the market. Jeremy then gifted Fred an additional 37 goats. If exactly half of the animals in the barn are male animals, how many male animals are there in the barn?
Fred's barn started with 100 + 29 + 9 = 
<gadget id="calculator">100+29+9</gadget>
<output>138</output>
138 animals.
Brian bought half of these, so there were 138 / 2 = 
<gadget id="calculator">138/2</gadget>
<output>69</output>
69 remaining.
After Jeremy gifted Fred 37 goats, there were 69 + 37 = 
<gadget id="calculator">69+37</gadget>
<output>106</output>
106 animals in the barn.
So, 106 / 2 = 
<gadget id="calculator">106/2</gadget>
<output>53</output>
53 of these animals are male.

<result>53</result>