Flat#2375

Flat

1 second
128 megabytes
Very easy

You are one of the developers of software for a real estate agency. One of the functions you are to implement is calculating different kinds of statistics for flats the agency is selling. Each flat consists of different types of rooms: bedroom, bathroom, kitchen, balcony, and others.

The cost of the flat is equal to the product of the reduced total area and the cost of one square meter. The reduced total area is the total area of all rooms except for balconies plus one half of the balconies' total area.

You will be given information about the area of each room in the flat and the cost of one square meter. You are to calculate the following values for the flat:

Input

The first line contains two integer numbers (1 \leq n \leq 10) and (1 \leq c \leq 100000) — the number of rooms in the flat and the cost of one square meter, respectively.

Each of the following lines contains an integer number a_i (1 \leq a_i \leq 100) and a word t_i — the area of the -th room and its type, respectively. The word t_i is one of the following: bedroom, bathroom, kitchen, balcony, other.

Output

The first line should contain one integer number — the total area of all rooms of the flat. The second line should contain one integer number — the total area of bedrooms of the flat. The third line should contain one real number — the cost of the flat with precision not worse than 10^{-6}.

The figure shows the flat from the first example.

prb2375

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading