Amy has divided a square up into finitely many white and red rectangles, each with sides parallel to the sides of the square. Within each white rectangle, she writes down its width divided by its height. Within each red rectangle, she writes down its height divided by its width. Finally, she calculates \( x \), the sum of these numbers. If the total area of the white rectangles equals the total area of the red rectangles, what is the smallest possible value of \( x \)?