Billy had wafers and Caden had muffins. Both gave half of what they had to each other. Billy sold 14 wafers and Caden sold 20 muffins. In the end, the ratios of wafers to muffins for Billy and Caden were 1 : 4 and 1 : 2 respectively. How many wafers did Billy have at first?