Lamar sold t-shirts and hats at a festival. He made a $4 profit for each t-shirt he sold. he also made a profit of $34 from selling hats. If he made a total profit of $160, how many t-shirts did he sell?