Without lifting his pencil from the paper, Petriukas drew the figure shown below.
Given the distances
A,
B,
C,
D, and
E, help determine the shortest possible distance the pencil could have traveled on the paper while drawing this figure.
Input
A single line contains five natural numbers A, B, C, D, E (1 \le A,B,C,D,E \le 1000)
Output
Print the minimum possible distance.
Example
standard input | standard output |
---|
5 4 6 2 7
| 30
|