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