Computer Configuration#7232

Computer Configuration

1 saniye
64 megabayt
Kolay

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.

Giriş

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.

Çıktı

Provide the maximum number of compatible computer sets that can be assembled.

Örnekler

Örnek 1

Loading
Loading