Archie had tarts and Luis had cookies. Both gave half of what they had to each other. Archie sold 8 tarts and Luis sold 34 cookies. In the end, the ratios of tarts to cookies for Archie and Luis were 1 : 7 and 1 : 5 respectively. How many tarts did Archie have at first?