There are two baskets, and both hold apples and oranges. The first basket holds A apples and B oranges. The second basket holds C apples and D oranges.
You may pick up one fruit and move it to the other basket. Repeat that until one basket holds only apples and the other holds only oranges. An empty basket counts as satisfying the condition.
Write a program that computes the minimum number of moves needed.
Input
The first line contains the number of apples A and the number of oranges B in the first basket, separated by a space. (0≤A,B≤1000)
The second line contains the number of apples C and the number of oranges D in the second basket, separated by a space. (0≤C,D≤1000)
Output
Print the minimum number of moves on the first line.