Martha has 3 children and wants each of them to have 18 small cakes. How many cakes would she need to buy?