In the country, there is a plan to build a city for programmers called Oskolkovo. This city will be large and will have streets, each with a_i houses. The government has decided to innovate by using plates with binary number representations to mark house numbers instead of the usual plates.
The first line contains three natural numbers (1 \le N \le 100), and (1 \le a, b \le 100): the number of streets and the costs of producing the digits and , respectively.
The next lines each begin with a natural number a_i (1 \le a_i \le 100) — the number of houses on that street. Each of these lines is followed by a_i natural numbers c_j (1 \le c_j \le 100), which are the house numbers for which plates need to be produced. Multiple plates may be required for a single house.
Output a single natural number: the total cost of producing all the plates.
Example 1