Silas had 3 times as much money as Raja. Silas spent $84 of his money to buy a birthday gift for his grandma while Raja was awarded $42 for winning a competition. In the end, they had the same amount of money. How much did they have altogether at first?