5. A toy factory produces cubic building blocks of the same size, with each face painted one of three colors: red, yellow, or blue, and each color is used on exactly 2 faces. When two blocks can be rotated to have the same color faces in the same positions, they are considered the same type of block. Try to explain: what is the maximum number of different types of blocks that can be painted?