A regular hexagon and a regular octagon have the same perimeter. If the side length of the hexagon is 4 cm, what is the side length of the octagon?

3 cm
4 cm
6 cm
8 cm