The figure below shows a square, each of whose sides is 3 centimetres long. Each side is divided into three equal parts and these points are joined to form an octagon:
What is the perimeter of the octagon?