A store sells two types of items: T-shirts and hats. Each T-shirt costs $12, and each hat costs $8. On a particular day, the store sold a total of 50 items (T-shirts and hats combined) and generated a total revenue of $520. How many T-shirts did the store sell that day?