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

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

wa=[0]*(N+1)

ac=[0]*(N+1)

ac_cnt=set()

for ps in PS:

    if ps[1]=='AC':

        ac_cnt.add(ps[0])

        ac[int(ps[0])]=1

    if ps[1]=='WA' and ac[int(ps[0])]==0:

        wa[int(ps[0])]+=1

for i in range(1,N+1):

    if str(i) not in ac_cnt:

        wa[i]=0

print((sum(ac),sum(wa)))

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

ac=[0]*(N+1)

wa=[0]*(N+1)

for i in range(M):

    p,s=input().split()

    if ac[int(p)]==1:

        continue

    if s=='AC':

        ac[int(p)]=1

    elif s=='WA':

        wa[int(p)]+=1



ac_ans,wa_ans=0,0

for a,w in zip(ac,wa):

    if a==0:

        continue

    ac_ans+=a

    wa_ans+=w



print((ac_ans,wa_ans))
N, M = list(map(int, input().split()))
PS = [list(input().split()) for _ in range(M)]
wa = [0] * (N + 1)
ac = [0] * (N + 1)
ac_cnt = set()
for ps in PS:
    if ps[1] == "AC":
        ac_cnt.add(ps[0])
        ac[int(ps[0])] = 1
    if ps[1] == "WA" and ac[int(ps[0])] == 0:
        wa[int(ps[0])] += 1
for i in range(1, N + 1):
    if str(i) not in ac_cnt:
        wa[i] = 0
print((sum(ac), sum(wa)))

N, M = list(map(int, input().split()))
ac = [0] * (N + 1)
wa = [0] * (N + 1)
for i in range(M):
    p, s = input().split()
    if ac[int(p)] == 1:
        continue
    if s == "AC":
        ac[int(p)] = 1
    elif s == "WA":
        wa[int(p)] += 1
ac_ans, wa_ans = 0, 0
for a, w in zip(ac, wa):
    if a == 0:
        continue
    ac_ans += a
    wa_ans += w
print((ac_ans, wa_ans))

-PS = [list(input().split()) for _ in range(M)] +ac = [0] * (N + 1) -ac = [0] * (N + 1) -ac_cnt = set() -for ps in PS: -    if ps[1] == "AC": -        ac_cnt.add(ps[0]) -        ac[int(ps[0])] = 1 -    if ps[1] == "WA" and ac[int(ps[0])] == 0: -        wa[int(ps[0])] += 1 -for i in range(1, N + 1): -    if str(i) not in ac_cnt: -        wa[i] = 0 -print((sum(ac), sum(wa))) +for i in range(M): +    p, s = input().split() +    if ac[int(p)] == 1: +        continue +    if s == "AC": +        ac[int(p)] = 1 +    elif s == "WA": +        wa[int(p)] += 1 +ac_ans, wa_ans = 0, 0 +for a, w in zip(ac, wa): +    if a == 0: +        continue +    ac_ans += a +    wa_ans += w +print((ac_ans, wa_ans))