Sam is twice as old as his brother Tim, and Tim is 5 years older than their cousin Lily. If the sum of their ages is 65 years, how old is Tim? Let's think step by step and output the final answer within \boxed{}.
user