A group of 5 children are choosing colored pencils to draw a picture. Each child is allowed to select one color. The available colors are green, red, and blue. If the second child refuses to use red pencils and the third child refuses to use blue pencils, then how many ways are there for the children to choose pencils? Assume that there are 10 pencils available of each color, and different children are allowed to choose the same color.