Paint three faces of an $8 \times 8$ cube red and three faces blue (requiring that any three faces sharing a common vertex cannot all be the same color), then cut it into 512 $1 \times 1 \times 1$ small cubes. Among these 512 small cubes, there are $\qquad$ small cubes that have both red and blue faces.
From the problem, any three faces sharing a common vertex cannot all be painted the same color. Therefore, let's assume the top, bottom, and front faces are painted red, and the left, right, and back faces are painted blue.
That is, in the cube $A B C D-E F G H$, the faces $E F G H$, $A B C D$, and $\mathrm{ABEF}$ are painted red, and the faces $A D H E$, $\mathrm{BCGF}$, and $\mathrm{DCGH}$ are painted blue.
Then, the small cubes on the edges shared by red and blue faces will have both red and blue faces.
That is, the small cubes on the edges $C D$, $\mathrm{GH}$, $\mathrm{AE}$, $\mathrm{BF}$, $\mathrm{AD}$, $\mathrm{BC}$, $\mathrm{FG}$, and $\mathrm{EH}$ will have both red and blue faces. Note that each small cube at the vertices is counted twice, i.e., it is overcounted once. Therefore, there are $8 \times 8-8=56$ small cubes that have both red and blue faces.