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

lis = [list(input().split()) for _ in range(M)]

AC = [[0] * 2 for i in range(N)]

for i in range(M):

    if lis[i][1] == "AC":

        AC[int(lis[i][0])-1][1] = 1

    elif AC[int(lis[i][0])-1][1] == 0:

        AC[int(lis[i][0])-1][0] += 1

a = 0

w = 0

for i in range(N):

    if AC[i][1] == 1:

        a += 1

        w += AC[i][0]

print((a, w))

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

P = [0] * 10**5

score, penalty = 0, 0

for i in range(M):

    p, s = list(map(str, input().split()))

    p = int(p)

    if s == 'AC' and P[p-1] != -1:

        penalty += P[p-1]

        score += 1

        P[p-1] = -1

    elif P[p-1] != -1:

        P[p-1] += 1

print((score, penalty))

N, M = list(map(int, input().split()))
lis = [list(input().split()) for _ in range(M)]
AC = [[0] * 2 for i in range(N)]
for i in range(M):
    if lis[i][1] == "AC":
        AC[int(lis[i][0]) - 1][1] = 1
    elif AC[int(lis[i][0]) - 1][1] == 0:
        AC[int(lis[i][0]) - 1][0] += 1
a = 0
w = 0
for i in range(N):
    if AC[i][1] == 1:
        a += 1
        w += AC[i][0]
print((a, w))

N, M = list(map(int, input().split()))
P = [0] * 10**5
score, penalty = 0, 0
for i in range(M):
    p, s = list(map(str, input().split()))
    p = int(p)
    if s == "AC" and P[p - 1] != -1:
        penalty += P[p - 1]
        score += 1
        P[p - 1] = -1
    elif P[p - 1] != -1:
        P[p - 1] += 1
print((score, penalty))

-lis = [list(input().split()) for _ in range(M)] -AC = [[0] * 2 for i in range(N)] +P = [0] * 10**5 +score, penalty = 0, 0 -    if lis[i][1] == "AC": -        AC[int(lis[i][0]) - 1][1] = 1 -    elif AC[int(lis[i][0]) - 1][1] == 0: -        AC[int(lis[i][0]) - 1][0] += 1 -a = 0 -w = 0 -for i in range(N): -    if AC[i][1] == 1: -        a += 1 -        w += AC[i][0] -print((a, w)) +    p, s = list(map(str, input().split())) +    p = int(p) +    if s == "AC" and P[p - 1] != -1: +        penalty += P[p - 1] +        score += 1 +        P[p - 1] = -1 +    elif P[p - 1] != -1: +        P[p - 1] += 1 +print((score, penalty))