The surface of a cube is painted red and blue, 3 sides of each color. the cube is then cut into 27 equal sized smaller cubes.

A: How many cubes have at least 2 sides painted blue?

B: How many cubes have at least 1 side painted red?