John has a bag of candies. He gave half of the candies to his friend. Then, he gave 10 candies to his sister and 15 candies to his cousin. If John has 5 candies left, how many candies did he have originally? Let's think step by step and output the final answer within \boxed{}.
user