Mary bought six apples from the store. For each apple that Mary ate, she planted two trees from the remaining apples. How many apples did Mary eat if she planted a total of 8 trees? Let's think step by step and output the final answer within \boxed{}.
user