Metro cards#578

Metro cards

1 second
64 megabytes
Easy

Some banks issue cards that can be used to pay for metro rides. Whenever you pass through a turnstile using such a card, each passage is recorded. At the end of each calendar month, the total number of passages is counted, and an amount is deducted from the card depending on the number of passages according to special rates (rates as of **15.10.2009**):

- If more than trips are made, euros are deducted for the first trips, and euros for each trip starting from the st. - Additionally, if at least one passage is made in the month, a bank commission of euros is deducted (regardless of the number of passages). If there are no passages in the month, the commission is not deducted.

Parents got two brothers, Petya and Vasya, such cards. Sometimes they travel together, sometimes separately. Naturally, when they travel separately, each uses his own card. When traveling together, each can use his own card, or both can use the same card (with two passages made on it).

They have also noticed that sometimes it is beneficial to make extra passages (for example, if there have been passages, it is worth making the th, since the amount deducted will be less).

It is known that Vasya plans to make independent trips, Petya plans to make independent trips, and they will make trips together next month (thus, in total, they will make A + B + 2C passages through the turnstile). Write a program that, given , , and , determines the minimum total amount they can spend (considering the bank commissions and possibly making extra passages if beneficial).

Input

The input contains integers , , (0 \leq A,B,C \leq 1000).

Output

Output the total amount in euros that will be deducted from Vasya's and Petya's cards. Print the result with two digits after the decimal point.

Examples

Example 1

Loading
Loading