# Arup Guha
# 11/9/2025
# Solution to JK Contest #1 Problem: ACM

# Will store wrong answers and time of correct submissions here.
numWA = []
timeCorrect = []

# Put in initial values.
for i in range(26):
    numWA.append(0)
    timeCorrect.append(-1)

# Get input.
toks = input().split()

# Loop as long as there are results.
while len(toks) == 3:

    # Get problem data.
    mytime = int(toks[0])
    prob = ord(toks[1]) - ord('A')

    # We got it, udpate the time
    if toks[2] == "right":
        timeCorrect[prob] = mytime

    # We didn't so update our WA count.
    else:
        numWA[prob] += 1

    # Get next.
    toks = input().split()

# My accumulators.
score = 0
penalty = 0

# Go through all possible problems.
for i in range(26):
    if timeCorrect[i] >= 0:
        score += 1
        penalty += timeCorrect[i] + 20*numWA[i]

# Ta da!
print(score, penalty)

    
