beecrowd | 2670

Coffee Machine

By Maratona de Programção da SBC, ACM ICPC 2017 BR Brazil

Timelimit: 1

The new building of the Brazilian Computer Society (SBC) has 3 floors. At certain times of the year, SBC employees drink a lot of coffee. Because of this, the president of SBC has decided to give the employees a new espresso machine. This machine is to be installed on one of the 3 floors, but the installation must be done in such a way that people do not waste too much time going up and down stairs.

Each employee of the SBC drinks 1 espresso a day. They have to go from the floor where they work to the floor where the machine is and back to their workstation. Every employee takes 1 minute to go up or down one floor. Since the SBC cares a lot about efficiency, she wants to position the machine in a way that minimizes the total time spent going up and down stairs.

Your task is to help management position the machine so that the total time spent by employees going up and down stairs is minimized.

Input

The input consists of 3 numbers, A1A2A3 (0 ≤ A1A2A3 ≤ 1000), one per line, where Arepresents the number of people working on the i-th floor.

Output

Your program is required to print a single line, containing the total number of minutes to be spent with the best possible positioning of the machine.

Input Sample Output Sample

10

20

30

80

10

30

20

60

30

10

20

100