Contest results
The members of the ship decided to take part in the programming Olympiad. The competition is held according to the ICPC rules.
You are given a sequence of the participant's submitions in the order in which the participant did them. For each sending, the moment of time at which it was made, the number of the task, and the verdict of the testing system are known. Find the number of tasks submitted by the participant and his total penalty.
The participant could send the task even after it had been submitted. The penalty for the task is calculated according to the formula t + 20 * k, where t is the time of the first successful submission of the task in minutes, k is the number of incorrect attempts before the first successful submition, excluding CE. The total penalty is calculated as the sum of penalties for all accepted tasks. There is no penalty for not solved tasks.
Input
The first line contains one integer n (1 ≤ n ≤ 10^5
) - the number of participant's submitions. The next n lines contain descriptions of submitions. The description of the i-th submition is given in the format "HH:MM X V", where:
"HH:MM" (0 ≤ HH ≤ 4, 0 ≤ MM ≤ 59) - submition time. Two digits indicating the number of hours and two digits indicating the number of minutes since the start of the contest.
"X" - task number, capital latin letter from 'A' to 'Z'.
"V" - verdict, value from the set OK, WA, TL, ML, RE, CE, SV. The OK verdict corresponds to an accepted submition.
Output
Print two integers - the number of accepted tasks and the total penalty.