#abc308b. [abc308_b]Default Price
[abc308_b]Default Price
Problem Statement
Takahashi ate plates of sushi at a sushi restaurant. The color of the -th plate is represented by a string .
The price of a sushi corresponds to the color of the plate. For each , the sushi on a plate whose color is represented by a string is worth yen a plate (yen is the currency of Japan). If the color does not coincide with any of , and , it is worth yen a plate.
Find the total amount of the prices of sushi that Takahashi ate.
Constraints
- and are strings of length between and , inclusive, consisting of lowercase English letters.
- , and are distinct.
- , , and are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
3 2
red green blue
blue red
800 1600 2800
Sample Output 1
5200
A blue
plate, red
plate, and green
plate are worth , , and yen, respectively.
The total amount of the prices of the sushi that he ate is yen.
Sample Input 2
3 2
code queen atcoder
king queen
10 1 1
Sample Output 2
21