Tim is preparing for a school science project. He decides to collect different types of rocks. He has 15 rocks of type A, 10 rocks of type B, and 20 rocks of type C. Later, he gives away 5 rocks of type B to his friend. How many rocks does Tim have left in total?