Adam had twice as many sheep as the cows, so 2 sheep/cow * 12 cows = <<2*12=24>>24 sheep.

For every sheep, he bought 3 pigs, so he bought 3 pigs/sheep * 24 sheep = <<3*24=72>>72 pigs.

In total on the farm, there were 72 pigs + 24 sheep + 12 cows = <<72+24+12=108>>108 animals.

# Answer

108
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
Adam had a farm with animals. He had 12 cows and twice as many sheep. He decided to buy 3 pigs for every sheep he had. How many animals were on the farm after the transaction?
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
108
Adam had a farm with animals. He had 12 cows and twice as many sheep. He decided to buy 3 pigs for every sheep he had. How many animals were on the farm after the transaction?
train