The diagram shows a rectangle that has been dissected into nine non-overlapping squares. Given that the width and the height of the rectangle are relatively prime positive integers (meaning two integers whose largest common divisor is 1), find the perimeter of the rectangle.