Abdul sold t-shirts and hats at a festival. He made a $6 profit for each t-shirt he told. He also made a profit of $54 from selling hats. If he made a total profit of $168, how many t-shirts did he sell?