In an infinite sequence of regular hexagons, each hexagon (except the first) is formed by connecting the midpoints of the sides of the previous hexagon. If the perimeter of the first hexagon is 12, find the sum of the perimeter of all the hexagons.