Michael had muffins and John had puffs. Both gave half of what they had to each other. Michael sold 10 muffins and John sold 40 puffs. In the end, the ratios of muffins to puffs for Michael and John were 1 : 8 and 1 : 6 respectively. How many muffins did Michael have at first?