n,m = list(map(int, input().split()))

ps = [input().split() for _ in range(m)]



problem = [0] * n

pp = [0]*n

b = ""

for p,s in ps:

    if problem[int(p)-1] == 0:

        if s == "WA":pp[int(p)-1] += 1

        else: problem[int(p)-1] = 1

ac = 0

pe = 0

for i in range(n):

    if problem[i] == 1:

        ac += 1

        pe += pp[i]

print((ac,pe))
n,m = list(map(int, input().split()))

ps = [list(input().split()) for _ in range(m)]



P = [0] * (n+1)

pena = [0] * (n+1)

for p,s in ps:

    p = int(p)

    if s == "WA":

        if P[p] == 0: pena[p] += 1

    else:

        P[p] = 1

ans = [0,0]

for p,pe in zip(P,pena):

    p = int(p)

    if p == 0: continue

    ans[0] += 1

    ans[1] += pe

print((" ".join(map(str, ans))))
n, m = list(map(int, input().split()))
ps = [input().split() for _ in range(m)]
problem = [0] * n
pp = [0] * n
b = ""
for p, s in ps:
    if problem[int(p) - 1] == 0:
        if s == "WA":
            pp[int(p) - 1] += 1
        else:
            problem[int(p) - 1] = 1
ac = 0
pe = 0
for i in range(n):
    if problem[i] == 1:
        ac += 1
        pe += pp[i]
print((ac, pe))

n, m = list(map(int, input().split()))
ps = [list(input().split()) for _ in range(m)]
P = [0] * (n + 1)
pena = [0] * (n + 1)
for p, s in ps:
    p = int(p)
    if s == "WA":
        if P[p] == 0:
            pena[p] += 1
    else:
        P[p] = 1
ans = [0, 0]
for p, pe in zip(P, pena):
    p = int(p)
    if p == 0:
        continue
    ans[0] += 1
    ans[1] += pe
print((" ".join(map(str, ans))))

-ps = [input().split() for _ in range(m)] -problem = [0] * n -pp = [0] * n -b = "" +ps = [list(input().split()) for _ in range(m)] +P = [0] * (n + 1) +pena = [0] * (n + 1) -    if problem[int(p) - 1] == 0: -        if s == "WA": -            pp[int(p) - 1] += 1 -        else: -            problem[int(p) - 1] = 1 -ac = 0 -pe = 0 -for i in range(n): -    if problem[i] == 1: -        ac += 1 -        pe += pp[i] -print((ac, pe)) +    p = int(p) +    if s == "WA": +        if P[p] == 0: +            pena[p] += 1 +    else: +        P[p] = 1 +ans = [0, 0] +for p, pe in zip(P, pena): +    p = int(p) +    if p == 0: +        continue +    ans[0] += 1 +    ans[1] += pe +print((" ".join(map(str, ans))))