An equilateral triangle of side length 1 is cut out of the middle of each side of a square of side length 3, as shown. What is the perimeter of the resulting figure?

An equilateral triangle of side length 1 is cut out of the middle of each side of a square of side length 3, as shown. What is the perimeter of the resulting figure?
