#abc251e. [abc251_e]Tahakashi and Animals
[abc251_e]Tahakashi and Animals
Problem Statement
Takahashi is with animals. The animals are called Animal , Animal , , Animal .
Takahashi will perform the following kinds of action. Each action can be performed any number of (possibly zero) times.
- Pay yen (the currency in Japan) to feed Animals and .
- Pay yen to feed Animals and .
- Pay yen to feed Animals and .
- Pay yen to feed Animals and .
- Pay yen to feed Animals and .
- Pay yen to feed Animals and .
- Pay yen to feed Animals and .
Note that the -th action above feeds "Animals and ."
Print the minimum possible total cost to feed every animal at least once.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the minimum possible total cost to feed every animal at least once.
Sample Input 1
Sample Output 1
If Takahashi performs the -st, -rd, and -th actions once each, Animals , , , , and are fed once, once, once, twice, once, respectively, so every animal is fed at least once. The total cost to do so is yen, which is the minimum possible.