Signboard#2714

Signboard

1 second
64 megabytes
Very easy

A shop's signboard is a word consisting of Latin letters. Over time, the signboard changes. If some letters break or fall off, they are replaced with the same letters. However, since letters of the desired case are not always available, a lowercase letter may be replaced by an uppercase letter and vice versa. One day, the store owner decides to make all the letters on the signboard have the same case. The cost of changing a lowercase letter to uppercase and the cost of the reverse operation are known.

Write a program that, given the current word and the costs of changing the case of the letters, determines the minimal cost to make all the letters have the same case.

Input

The first line contains the word on the signboard, consisting of lowercase or uppercase Latin letters, and containing no more than characters. The next line contains two natural numbers, each not exceeding : the first is the cost of replacing a lowercase letter with an uppercase letter, the second is the cost of replacing an uppercase letter with a lowercase letter.

Output

Output the minimal total cost to make all the letters the same case.

Examples

Example 1

Loading
Loading