Riordan had cookies and Oliver had biscuits. Both gave half of what they had to each other. Riordan sold 10 cookies and Oliver sold 40 biscuits. In the end, the ratios of cookies to biscuits for Riordan and Oliver were 1 : 6 and 1 : 4 respectively. How many cookies did Riordan have at first?