URI Online Judge | 2813

Avoiding Rain

By Christian Bonilha, UTFPR Brazil

Timelimit: 1

Rafael hates rain, and to avoid getting wet he started to use a weather forecasting system. In this system he can predict if it's going to rain at the time he goes to work and/or at the time he comes back from work.

Rafael also hates to carry an umbrella when it's not raining. To avoid it, he's going to buy several umbrellas and store them
at home and at the office, and he's only going to use it when it's raining. In other words, if it's raining at the time he goes to work, he'll take an umbrella that is at home, use it on the way to work, and leave it there. In a similar way, if it's raining at the time he comes back from work, he'll take an umbrella that is at the office, use it on the way home, and leave it there.

Given the meteorological forecasts, find out how many umbrellas Rafael must buy and store at home and at the office, in a way that he never gets wet and he never has to carry an umbrella if it's not raining.

Input

The first input row has an integer N, indicating how many days were forecast by the meteorological system (1 <= N <= 1000).

Following there will be N rows, each with two words SD and SN, indicating the forecast of the day at the time Rafael goes to work, and at the time Rafael comes back from work, respectively. If the word is "sol", it means that at this time it's not going to rain, and if the word is "chuva", it means that at this time it's going to rain.

Output

For each test case, you should print one row with two integers C and E, indicating how many umbrellas Rafael must buy and store at home and at the office.

 Input Samples Output Samples 3 sol chuva sol chuva sol chuva 0 3
 2 sol chuva chuva sol 0 1