There is a pie-eating contest at school. Adam eats three more pies than Bill. Sierra eats twice as many pies as Bill. If Sierra ate 12 pies, how many pies were eaten in total?