The perimeter of an octagon is 32 inches and its longest side is 6 inches. What is the longest side of a similar octagon with a perimeter of 24 inches ?