Two pirates were playing with golden coins. At the start of the game, the first pirate lost half of his coins to the second pirate, then the second pirate lost half of his coins to the first one, then again the first lost half of his coins to the second pirate. At the end of the game, the first pirate had 15 coins, and the second had 33 coins. How many coins did the first pirate have initially?