Mary has 18 pieces of candy to give to 9 of her friends. If each friend gets the same number of pieces, how many will each friend get ?

A. 27 pieces

B. 18 pieces

C. 9 pieces

D. 2 pieces