Alex has a certain number of apples. He buys 20 more apples from the market. Then he gives 15 apples to his friend and eats 10 apples himself. If Alex has 25 apples left after all this, how many apples did he initially have? Let's think step by step and output the final answer within \boxed{}.
user