Bob goes shopping at his favorite store and finds a hat that is regularly priced at $40, but it is on sale for 20% off. The sales tax on the hat is 10% of the sale price. How much does Bob end up paying for the hat?