The available system units are as follows: a_1 supports only the VGA interface, a_2 supports only the DVI interface, and a_3 supports both VGA and DVI interfaces. Similarly, for monitors: b_1 supports only VGA, b_2 supports only DVI, and b_3 supports both interfaces.
Determine the maximum number of computer sets that can be assembled, ensuring each set has a compatible graphics interface between the system unit and the monitor.
The first line contains three numbers: a_1, a_2, and a_3. The second line contains three numbers: b_1, b_2, and b_3. All numbers are non-negative integers.
The constraints are: 0 \le a_1, a_2, a_3, b_1, b_2, b_3 \le 100 and a_1 + a_2 + a_3 = b_1 + b_2 + b_3.
Provide the maximum number of compatible computer sets that can be assembled.
Örnek 1