Hugo's family ordered 5 dishes at a restaurant. Since Hugo's father's friend's uncle is the owner of the restaurant, Hugo enjoys a $\$100$ discount if the bill is at least $\$500$. Otherwise, he enjoys a $\$50$ discount if the bill is at least $\$300$.

You are to calculate how much Hugo's family paid for the meal.

Input

The only line of input contains 5 integers, the price of each dish ordered by his family.
The price of every dish sold at the restaurant is between $\$10$ and $\$200$.

Output

Output the required sum.

Sample Test Cases

Input Output
50 50 50 50 50 250
70 70 70 70 70 300
120 130 140 150 160 600
Click to copy.

Scoring: Per Subtask
Authored by s16f22
Appeared in 2023 Children's Day Mini Contest