beecrowd | 1218

Getline Three - Shoes

By Neilor Tonin, URI Brazil

Timelimit: 1

Now that Mangojata solved some problems using getline, she is able to take a step forward. She is about to make a new program to help her sister, Overlaine. Overlaine is a seller of shoes and by a neglect, mixed all shoes of each box. Now she wants to inform any number N and count how many shoes of this size (N) exists inside a specific box. The problem is that Overlaine have no any idea how many shoes are in each box. The only thing we know is that each footwear may be numbered 20-44, and may be male or female.

Input

The input contains several test cases and ends with EOF (End of File). Each test case is composed by two lines. The first line contains a number (20 ≤ ≤ 44)  of a shoe informed by Oveline. The second line contains the number of each pair that are inside the box, followed by M or N, indicating if this shoes are Masculine or Feminine.

Output

For each test case print four lines, like given example. In the first line you must print the message “Caso n:”, where n is the number of the test case. In the second line you must print the message “Pares Iguais:” followed by how many pairs of shoes have the same size of that wich Overlaine wants to find. Follow two lines with the respective among of Feminine (F) and Masculine (M) shoes, with corresponding message.

Print a blank line between the outputs for two consecutive test cases.

Sample Input Sample Output

23
23 F 28 M 23 F 40 M 36 F 23 M 23 F 24 M 23 M
28
22 M 23 F 28 M 32 F

Caso 1:
Pares Iguais: 5
F: 3
M: 2

Caso 2:
Pares Iguais: 1
F: 0
M: 1