N, M = list(map(int, input().split()))



penalty = 0

nums = [0] * N

isACs = [False] * N

for _ in range(M):

    p, ss = input().split()

    p = int(p) - 1

    if ss == 'WA':

        nums[p] += 1

    else:

        if not isACs[p]:

            penalty += nums[p]

        isACs[p] = True



numAC = isACs.count(True)

print((numAC, penalty))

N, M = list(map(int, input().split()))



isACs = [0] * N

numWAs = [0] * N

numPenalty = 0

for _ in range(M):

    p, res = input().split()

    p = int(p) - 1

    if res == 'AC':

        if not isACs[p]:

            numPenalty += numWAs[p]

        isACs[p] = 1

    else:

        numWAs[p] += 1



numAC = sum(isACs)

print((numAC, numPenalty))

N, M = list(map(int, input().split()))
penalty = 0
nums = [0] * N
isACs = [False] * N
for _ in range(M):
    p, ss = input().split()
    p = int(p) - 1
    if ss == "WA":
        nums[p] += 1
    else:
        if not isACs[p]:
            penalty += nums[p]
        isACs[p] = True
numAC = isACs.count(True)
print((numAC, penalty))

N, M = list(map(int, input().split()))
isACs = [0] * N
numWAs = [0] * N
numPenalty = 0
for _ in range(M):
    p, res = input().split()
    p = int(p) - 1
    if res == "AC":
        if not isACs[p]:
            numPenalty += numWAs[p]
        isACs[p] = 1
    else:
        numWAs[p] += 1
numAC = sum(isACs)
print((numAC, numPenalty))

-penalty = 0 -nums = [0] * N -isACs = [False] * N +isACs = [0] * N +numWAs = [0] * N +numPenalty = 0 -    p, ss = input().split() +    p, res = input().split() -    if ss == "WA": -        nums[p] += 1 +    if res == "AC": +        if not isACs[p]: +            numPenalty += numWAs[p] +        isACs[p] = 1 -        if not isACs[p]: -            penalty += nums[p] -        isACs[p] = True -numAC = isACs.count(True) -print((numAC, penalty)) +        numWAs[p] += 1 +numAC = sum(isACs) +print((numAC, numPenalty))