eolymp
bolt
Try our new interface for solving problems
Problems

Signboard

Signboard

Time limit 1 second
Memory limit 64 MiB

signboard of a shop is a word of Latin letters. Over time, the sign changed. If broken, or fall off some letters, they were replaced on the same. But, as letters of the register does not always have been, could be replaced by a small letter to big, or vice versa, in large letters on a little. One day, the owner of the store tired such mockery, and he decided to bring all the letters in a sign the register. He was aware of the cost of replacing capital letters on the small and the cost of the reverse operation.

Write a program that defines the current row of signs, and the cost of replacing the casing, the minimum cost of bringing the characters to sign one register.

Input data

The first line contains the word signs, consisting of a lowercase or uppercase Roman letters, not exceeding 100 characters. The following line contains two natural numbers not greater than 10000, the first - the cost of replacing a small letter to big, the second - the cost of replacing the large letters on the small one.

Output data

In the first line of output file output the desired minimum cost of replacing the letters.

Examples

Input example #1
BAkERY
6 1
Output example #1
5