Four houses in a row are each to be painted with one of the colors red, blue, green, and yellow. In how many different ways can the houses be painted so that no two adjacent houses are of the same color? There are possible ways to paint the houses.