Colorful Balls#248

Colorful Balls

1 second
256 megabytes
Easy

Bodya found three boxes on the way to school. Each box contains a certain number of yellow and blue balls. Bodia decided to arrange them in such a way that one of the three boxes would be empty, one would contain only yellow balls, and one would contain only blue balls.

Bodya doesn't want to be late for the first lesson, help him determine the minimum number of rearrangements to organize the balls in the boxes.

Input

The first line contains two integers y_1,b_1 (0\le y_1,b_1\le 100) — the number of yellow and blue balls in the first box, respectively.

The second line contains two integers y_2,b_2 (0\le y_2,b_2\le 100) — the number of yellow and blue balls in the second box, respectively.

The third line contains two integers y_3,b_3 (0\le y_3,b_3\le 100) — the number of yellow and blue balls in the third box, respectively.

Output

Output a single number — the minimum number of rearrangements.

Examples

Example

Loading
Loading

Example 1

Loading
Loading

Note

Explanation for the first test: