// Arup Guha
// 3/5/2016
// Solution to 2015 MCPC Problem A: ACM Contest Scoring

import java.util.*;

public class acm {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int t = stdin.nextInt();

		// Set up no submissions.
		int[] badTries = new int[26];
		int[] min = new int[26];
		Arrays.fill(min, -1);

		// Go through all entries.
		while (t != -1) {

			// Parse out other info.
			int prob = stdin.next().charAt(0) - 'A';
			boolean correct = stdin.next().equals("right");

			// Do nothing with previously correct problems.
			if (min[prob] != -1) continue;

			// Update either incorrect or correct.
			if (!correct)
				badTries[prob]++;
			else
				min[prob] = t;

			// Get next entry.
			t = stdin.nextInt();
		}

		// Add up score and penalty over all questions.
		int score = 0, pen = 0;
		for (int i=0; i<26; i++) {
			if (min[i] != -1) {
				score++;
				pen += min[i] + badTries[i]*20;
			}
		}

		// Output result.
		System.out.println(score+" "+pen);
	}
}