You are one of the developers of software for a real estate agency. One of the functions you must implement calculates various statistics for the flats the agency is selling. Each flat consists of rooms of different types: bedroom, bathroom, kitchen, balcony, and others.
The cost of a flat equals the product of its reduced total area and the cost of one square metre. The reduced total area is the total area of all rooms except balconies, plus one half of the total area of the balconies.
You are given the area of each room in the flat and the cost of one square metre. Compute the following values for the flat:
The first line contains two integers $n$ ($1 \le n \le 10$) and $c$ ($1 \le c \le 100000$) — the number of rooms in the flat and the cost of one square metre, respectively.
Each of the next $n$ lines contains an integer $a_i$ ($1 \le a_i \le 100$) and a word $t_i$ — the area of the $i$-th room and its type, respectively. The word $t_i$ is one of: bedroom, bathroom, kitchen, balcony, other.
Print three lines.
The first line contains one integer — the total area of all rooms of the flat.
The second line contains one integer — the total area of all bedrooms of the flat.
The third line contains the cost of the flat. The cost is always a multiple of one half. If the cost is a whole number, print it as an integer with no decimal point; otherwise print it with exactly one digit after the decimal point (that digit is always 5).
The figure shows the flat from the first sample.
