Daphne wanted to buy candy to give to her colleagues. She spent $576 to buy the candy. If each piece of candy costs $18, how many pieces of candy did she buy?