Canteen Checkout

No attempts yetTime limit1sMemory limit64 MB

Problem

One lady works the register of the school canteen. Students like her partly because she keeps their bills as small as she can.

Her method is simple. Every meal sold in the canteen has a fixed price, and one set menu is on sale each day. A set menu consists of 4 meals, usually a soup, a main course, a side dish and a dessert, and its price is at most the sum of the prices of those 4 meals. When charging a set menu comes out cheaper than charging the meals on the tray one by one, she charges the set menu. She charges a set price even when the tray holds fewer than all 4 meals of the set.

The bill for mm set menus is fixed as follows. The sets cost m×Xm \times X, and for each meal of the set menu at most mm portions are covered by the sets and are not charged separately. Every portion left uncovered is charged at its own price. She picks the mm that makes the bill smallest.

You stand in front of the register with your tray. Write a program that determines the amount you have to pay.

Input

The first line contains the number of meals sold in the canteen, KK (1K201 \le K \le 20). For simplicity the meals are denoted by the integers from 11 to KK.

The second line contains KK integers. The iith number is the price of meal ii, between 11 and 250250.

The third line contains the price of the set menu, XX (1X<10001 \le X < 1000).

The fourth line contains the labels of the 4 meals that form the set menu. The four labels are different from each other.

The fifth line contains the number of meals on your tray, TT (1T201 \le T \le 20).

The sixth line contains the labels of the TT meals on your tray. The same meal may be taken in several portions.

Output

Print the amount you have to pay as an integer on the first line.

Hint

In the first example the tray holds meals 1, 3 and 4, which belong to the set menu, so the lady charges those three portions as one set menu. Meals 6 and 7 are not part of the set, so they are charged at their own prices.

In the second example the tray holds two portions of meal 1. The lady charges one of them together with one portion of meal 2 as a single set menu and charges the other portion separately, because a second set menu would cost more. Meal 6 is taken twice as well, but it is not part of the set, so both portions are charged at their own price.