Rita bought some books for $3 each and received a discount of $6 off of her total purchase. She spent $45 after the discount. How many books did she buy?