One face of a cube is painted red. The other five faces are painted either red or blue, each with probability . The colors are determined independently. What is the probability that the painted cube can be placed on a horizontal surface so that the four vertical faces are all the same color?