Andrea is three times as old as Jim was when Jim was twice as old as he was when the sum of their ages was $47$. If Andrea is $29$ years older than Jim, what is the sum of their ages now?

Let's think step by step and output the final answer within \boxed{}.
user