Hi, welcome to 平顶山学院OnlineJudge and best regards to you! To avoid bringing you any troubles, you should know our system how to judge your contest score after you submit your code. Your task in this problem is to compute the score for a number of submissions from a programming contest contestant.
Each line of input contains a problem identifier (a single letter from A to Z), a time (in minutes from 0 to 300), and a judgement (the word "correct" or the word "incorrect"). The input is in ascending order by time, and there will be at most one "correct" judgement for each problem. A line containing '-' follows the last line of input.
The output has two components: solved and penalty. solved is the number of distinct problems with a "correct" judgement. penalty is the sum of the time at which each distinct problem is first judged "correct", and 20 for each "incorrect" submission for a problem that is later judged "correct".