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

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



ac = [0] * (n+1)

pena = [0] * (n+1)

for p,s in ps:

    p = int(p)

    if ac[p] == 0:

        if s == "WA": pena[p] += 1

        else: ac[p] = 1

ans = [0,0]

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

    if ac[i] == 1:

        ans[0] += 1

        ans[1] += pena[i]

print((" ".join(map(str, ans))))
n,m = list(map(int, input().split()))

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



ac = [0] * (n+1)

pena = [0] * (n+1)

for p,s in ps:

    p = int(p)

    if s == "AC":

        ac[p] = 1

        continue

    if ac[p] == 0:

        pena[p] += 1

ans = [0,0]

for x,y in zip(ac[1:],pena[1:]):

    if x == 1:

        ans[0] += 1

        ans[1] += y

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

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

+    if s == "AC": +        ac[p] = 1 +        continue -        if s == "WA": -            pena[p] += 1 -        else: -            ac[p] = 1 +        pena[p] += 1 -for i in range(1, n + 1): -    if ac[i] == 1: +for x, y in zip(ac[1:], pena[1:]): +    if x == 1: -        ans[1] += pena[i] +        ans[1] += y