87; If he gave two thirds of his remaining cards to Elaine, then he had one third left. If one third of his remaining cards is 25, then 25 x 3 will give you what he had after trading with Tommy. When he finished trading with Tommy he had 75 cards. if he gave away 15 cards, but got three back, then he must have had 87 cards to begin with.
Check your answer:
87-15 = 72
72+3 = 75
2/3 of 75 = 50
75-50 = 25
Great!