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

p = [0] * M

s = [0] * M

for i in range(M):

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

    p[i] = int(p[i])



'''

a = [0] * M

for i in range(M):

    a[i] = [p[i],s[i]]

'''

maru = [0] * (N+1)

batu = [0] * (N+1)



for i in range(M):

    if s[i] == "AC" and maru[p[i]] == 0:

        maru[p[i]] += 1 

    elif s[i] == "AC" and maru[p[i]] != 0:

        continue

    elif s[i] == "WA" and maru[p[i]] != 0:

        continue

    elif s[i] == "WA" and maru[p[i]] == 0:

        batu[p[i]] += 1



batu_ans = 0

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

    if maru[i] != 0:

        batu_ans += batu[i]



print((sum(maru), batu_ans))
N, M = list(map(int, input().split()))

wro = dict()

cor = set()



for _ in range(M):

    p, s = input().split()

    if s == 'AC':

        cor.add(p)

    elif s == 'WA' and p not in cor:

        wro[p] = wro.get(p, 0) + 1



wro_num = 0

for i in cor:

    wro_num += wro.get(i, 0)



print((len(cor), wro_num))
N, M = list(map(int, input().split()))
p = [0] * M
s = [0] * M
for i in range(M):
    p[i], s[i] = list(map(str, input().split()))
    p[i] = int(p[i])
"""
a = [0] * M
for i in range(M):
    a[i] = [p[i],s[i]]
"""
maru = [0] * (N + 1)
batu = [0] * (N + 1)
for i in range(M):
    if s[i] == "AC" and maru[p[i]] == 0:
        maru[p[i]] += 1
    elif s[i] == "AC" and maru[p[i]] != 0:
        continue
    elif s[i] == "WA" and maru[p[i]] != 0:
        continue
    elif s[i] == "WA" and maru[p[i]] == 0:
        batu[p[i]] += 1
batu_ans = 0
for i in range(1, N + 1):
    if maru[i] != 0:
        batu_ans += batu[i]
print((sum(maru), batu_ans))

N, M = list(map(int, input().split()))
wro = dict()
cor = set()
for _ in range(M):
    p, s = input().split()
    if s == "AC":
        cor.add(p)
    elif s == "WA" and p not in cor:
        wro[p] = wro.get(p, 0) + 1
wro_num = 0
for i in cor:
    wro_num += wro.get(i, 0)
print((len(cor), wro_num))

-p = [0] * M -s = [0] * M -for i in range(M): -    p[i], s[i] = list(map(str, input().split())) -    p[i] = int(p[i]) -""" -a = [0] * M -for i in range(M): -    a[i] = [p[i],s[i]] -""" -maru = [0] * (N + 1) -batu = [0] * (N + 1) -for i in range(M): -    if s[i] == "AC" and maru[p[i]] == 0: -        maru[p[i]] += 1 -    elif s[i] == "AC" and maru[p[i]] != 0: -        continue -    elif s[i] == "WA" and maru[p[i]] != 0: -        continue -    elif s[i] == "WA" and maru[p[i]] == 0: -        batu[p[i]] += 1 -batu_ans = 0 -for i in range(1, N + 1): -    if maru[i] != 0: -        batu_ans += batu[i] -print((sum(maru), batu_ans)) +wro = dict() +cor = set() +for _ in range(M): +    p, s = input().split() +    if s == "AC": +        cor.add(p) +    elif s == "WA" and p not in cor: +        wro[p] = wro.get(p, 0) + 1 +wro_num = 0 +for i in cor: +    wro_num += wro.get(i, 0) +print((len(cor), wro_num))