Diamond#1917

Diamond

1 secondo
64 megabyte
Facile

You are a big fan of jewelry and gemstones. Recently, a remarkable diamond was put for sale in the jewelry store next to your house. However, its price was also remarkable — dollars. Unfortunately, you had to admit that this was too expensive for you, no matter how much you liked the diamond itself.

Apparently, other potential buyers felt the same way, because soon the store started an advertising campaign. "Get a discount for each letter in your name!" read the sign at the entrance. This wording was not very clear, so you decided to ask the staff. After talking with them, it turned out that:

Of course, it would be a shame not to take advantage of such a generous offer, but maybe you can save even more. By a stroke of luck, you recently met a person who forges passports. His services are paid as follows:

Given , , , , , and your real name , determine the minimum total amount of money needed to obtain the diamond (including the amount paid for the diamond and for the forged passport, if any). Forging a passport is not required; you may also simply present your real passport with the name when buying.

Input

The first line contains the integer . The second line contains the integers , , , and (1 \le X, A, B, C, D \le 1000000), separated by single spaces. The third line contains . contains from to characters, all of which are lowercase English letters.

Output

Print the minimum amount of money needed to obtain the diamond, in cents (there are cents in one dollar).

Esempi

Esempio 1

Loading
Loading