Please reason step by step, and put your final answer within \boxed{}.
Bogan laid out 10 maggots for her pet beetle. The beetle ate some maggots and Bogan had to throw out the rest. Later that day, she tried feeding again and the beetle ate 3. If Bogan served 20 maggots in total, how many did the beetle eat the first time?
user