When Katya goes on a trip, she always takes three suitcases with her. She packs all her clothes in first, which weighs $$$x$$$ kilograms. In the second, she packs cosmetics weighing $$$y$$$ kilograms. And in the third suitcase, she packs shoes weighing $$$z$$$ kilograms.
Katya checked the airline's website for baggage fees in advance. If she checks in the suitcases with a total weight of less than 5 kilograms, the cost will be $$$a$$$ rubles. If the weight is 5 or more but less than 10 kilograms, the cost will be $$$b$$$ rubles. And if the weight is 10 kilograms or more, the price will be $$$c$$$ rubles.
Help Katya send all the suitcases and pay as little as possible.
The first line contains the number $$$x$$$ ($$$1 \le x \le 10$$$)—the weight of the first suitcase. The second line contains the number $$$y$$$ ($$$1 \le y \le 10$$$)—the weight of the second suitcase. The third line contains the number $$$z$$$ ($$$1 \le z \le 10$$$)—the weight of the third suitcase. The fourth line contains the number $$$a$$$ ($$$1 \le a \le 100$$$)—the cost for sending less 5 kilograms. The fifth line contains the number $$$b$$$ ($$$1 \le b \le 100$$$)—the cost for sending from 5 kilograms inclusive to less than 10 kilograms. The sixth line contains the number $$$c$$$ ($$$1 \le c \le 100$$$)—the cost for sending 10 kilograms or more.
Print the minimum cost of sending the three suitcases.
235101525
25
| Name |
|---|


