There are 4 ways to color the red sides, then three ways to color the yellow sides, then two ways to color the green sides, then o one way to color the blue sides. This gives us a count of 24.
But there are 8 ways to rotate the octagon, so the answer is 24/8 = 3.