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

sub = [list(input().split()) for i in range(M)]



wa = [0 for i in range(N)]



ac = [0 for i in range(N)]



waans = 0

acans = 0



for i in range(M):

    if sub[i][1] == 'AC' and ac[int(sub[i][0])-1] == 0:

        acans += 1

        waans += wa[int(sub[i][0])-1]

        ac[int(sub[i][0])-1] = 1

    elif sub[i][1] == 'WA' and ac[int(sub[i][0])-1] == 0:

        wa[int(sub[i][0])-1] += 1



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

pro = [0 for i in range(N+1)]

ac,wa = 0,0

for i in range(M):

    p,s = input().split()

    p = int(p)

    if s == 'AC':

        if pro[p] != -1:

            ac += 1

            wa += pro[p]

            pro[p] = -1

    else:

        if pro[p] != -1:

            pro[p] += 1

print((ac,wa))

N, M = list(map(int, input().split()))
sub = [list(input().split()) for i in range(M)]
wa = [0 for i in range(N)]
ac = [0 for i in range(N)]
waans = 0
acans = 0
for i in range(M):
    if sub[i][1] == "AC" and ac[int(sub[i][0]) - 1] == 0:
        acans += 1
        waans += wa[int(sub[i][0]) - 1]
        ac[int(sub[i][0]) - 1] = 1
    elif sub[i][1] == "WA" and ac[int(sub[i][0]) - 1] == 0:
        wa[int(sub[i][0]) - 1] += 1
print((acans, waans))

N, M = list(map(int, input().split()))
pro = [0 for i in range(N + 1)]
ac, wa = 0, 0
for i in range(M):
    p, s = input().split()
    p = int(p)
    if s == "AC":
        if pro[p] != -1:
            ac += 1
            wa += pro[p]
            pro[p] = -1
    else:
        if pro[p] != -1:
            pro[p] += 1
print((ac, wa))

-sub = [list(input().split()) for i in range(M)] -wa = [0 for i in range(N)] -ac = [0 for i in range(N)] -waans = 0 -acans = 0 +pro = [0 for i in range(N + 1)] +ac, wa = 0, 0 -    if sub[i][1] == "AC" and ac[int(sub[i][0]) - 1] == 0: -        acans += 1 -        waans += wa[int(sub[i][0]) - 1] -        ac[int(sub[i][0]) - 1] = 1 -    elif sub[i][1] == "WA" and ac[int(sub[i][0]) - 1] == 0: -        wa[int(sub[i][0]) - 1] += 1 -print((acans, waans)) +    p, s = input().split() +    p = int(p) +    if s == "AC": +        if pro[p] != -1: +            ac += 1 +            wa += pro[p] +            pro[p] = -1 +    else: +        if pro[p] != -1: +            pro[p] += 1 +print((ac, wa))