ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules

NEERC 2009, Eastern subregional contest

About     Problems     Submit solution     Judge status     Standings
Contest is over

H. Rejudge

Time limit: 0.5 second
Memory limit: 64 MB
At three o’clock in the morning Sasha (aka Sandro) discovered that there were only seven tests for one of the problems in the first volume of the Timus Online Judge. “That won’t do,” Sasha thought and added ten new tests for that problem. At four o’clock in the morning, Vova (aka Vladimir Yakovlev) discovered that the sixth test in the same problem was incorrect. “That won’t do,” Vova thought and deleted the sixth test.
The next day Sasha and Vova came to work at two o’clock in the afternoon. After some discussion they decided to rejudge all the solutions for that problem that had been submitted before the moment Sasha added new tests.
After the rejudge each author receives an e-mail with the list of all her solutions for which the outcome has changed. If that list is empty the e-mail is not sent. Help Sasha and Vova determine the minimal possible and maximal possible number of authors who will receive an e-mail with the rejudge results.

Input

The first line contains the number of solutions n that Sasha and Vova want to rejudge (1 ≤ n ≤ 1000). Each of the following n lines describes one solution and contains the name of its author and the previous outcome.
The name of the author is a nonempty string of length not exceeding 30. It may contain Latin letters, digits, the underscore character, parentheses and square brackets. It is guaranteed that no two different authors have names which differ only in case of the letters.
The possible outcomes are: AC, CE, ML X, TL X, and WA X, where X is an integer from 1 to 7. The outcome AC means that the solution passed all the tests. The outcome CE means that the solution failed to compile and, therefore, was not launched on any of the tests. The outcomes ML X, TL X, and WA X mean that the solution passed the tests with numbers less than X but failed to pass the test X because it exceeded the memory limit or the time limit or because it produced a wrong answer. The outcomes which differ only in test number are considered different.

Output

Output the minimal possible and maximal possible number of authors who will receive e-mails with the rejudge results.

Sample

inputoutput
5
[SPbSU_ITMO]_WiNGeR TL 6
Milanin_(TNU) WA 6
Vladimir_Yakovlev_(USU) AC
Sandro_(USU) WA 1
Sandro_(USU) ML 3
0 3
Problem Author: Alexander Ipatov (prepared by Alex Samsonov)
Problem Source: NEERC 2009, Eastern subregional contest
To submit the solution for this problem go to the Problem set: 1718. Rejudge