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