In some blackblack wood at the blackblack cemetery there was a golden gravestone. This gravestone was guarded by two blackblack dogs. Each dog sits enchained near a blackblack pole and nearby in the wood there is a blackblack guard’s house. Every morning the guard leaves the house to bring the dogs plates with food. He places the plates so that the dogs may eat remaining enchained to their poles.
Compute the shortest way that the guard is to walk in order to feed both dogs (the guard may easily carry food to both dogs at the same time and may feed them in an arbitrary order).
Input
The first line contains three numbers: the distance in meters from the guard’s house to the first pole R_{1}, from the guard’s house to the second pole R_{2} and the distance between the poles R_{3}. The second line consists of one integer which is the length of each dog’s chain R_{4} (the chains of the dogs are identical). The numbers R_{i} (i = 1, 2, 3) satisfy the restriction 0 ≤ R_{i} ≤ 20000; 1 ≤ R_{4} ≤ 20000.
Output
Output the single number which is the length of the shortest guard’s way in meters within three digits after a decimal point.
Sample
input  output 

1000 2000 1000
250
 3500.000

Problem Author: Alexander Petrov (prepared by Alexander Mironenko)
Problem Source: Open collegiate programming contest for student teams, Ural State University, March 15, 2003