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