Emma has a collection of 240 marbles. She decides to share them equally among her 12 friends. After giving each friend an equal number of marbles, she has 18 marbles left over. How many marbles did she give to each friend?