N, M = [int(_) for _ in input().split()]

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

count = [0] * (N + 1)

isac = [0] * (N + 1)

for p, s in PS:

    p = int(p)

    if isac[p] == 1:

        continue

    if s == 'AC':

        isac[p] = 1

    else:

        count[p] += 1

wa = 0

ac = 0

for i in range(N + 1):

    if isac[i] == 1:

        ac += 1

        wa += count[i]

print((ac, wa))

N, M, *PS = open(0).read().split()

N, M = [int(_) for _ in [N, M]]

cor = [0] * (N + 1)

pen = [0] * (N + 1)

for p, s in zip(PS[::2], PS[1::2]):

    p = int(p)

    if cor[p] == 1:

        continue

    if s == 'AC':

        cor[p] = 1

    else:

        pen[p] += 1

ans = [0, 0]

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

    if cor[i] == 0:

        continue

    ans[0] += 1

    ans[1] += pen[i]

print((*ans))

N, M = [int(_) for _ in input().split()]
PS = [input().split() for _ in range(M)]
count = [0] * (N + 1)
isac = [0] * (N + 1)
for p, s in PS:
    p = int(p)
    if isac[p] == 1:
        continue
    if s == "AC":
        isac[p] = 1
    else:
        count[p] += 1
wa = 0
ac = 0
for i in range(N + 1):
    if isac[i] == 1:
        ac += 1
        wa += count[i]
print((ac, wa))

N, M, *PS = open(0).read().split()
N, M = [int(_) for _ in [N, M]]
cor = [0] * (N + 1)
pen = [0] * (N + 1)
for p, s in zip(PS[::2], PS[1::2]):
    p = int(p)
    if cor[p] == 1:
        continue
    if s == "AC":
        cor[p] = 1
    else:
        pen[p] += 1
ans = [0, 0]
for i in range(1, N + 1):
    if cor[i] == 0:
        continue
    ans[0] += 1
    ans[1] += pen[i]
print((*ans))

-N, M = [int(_) for _ in input().split()] -PS = [input().split() for _ in range(M)] -count = [0] * (N + 1) -isac = [0] * (N + 1) -for p, s in PS: +N, M, *PS = open(0).read().split() +N, M = [int(_) for _ in [N, M]] +cor = [0] * (N + 1) +pen = [0] * (N + 1) +for p, s in zip(PS[::2], PS[1::2]): -    if isac[p] == 1: +    if cor[p] == 1: -        isac[p] = 1 +        cor[p] = 1 -        count[p] += 1 -wa = 0 -ac = 0 -for i in range(N + 1): -    if isac[i] == 1: -        ac += 1 -        wa += count[i] -print((ac, wa)) +        pen[p] += 1 +ans = [0, 0] +for i in range(1, N + 1): +    if cor[i] == 0: +        continue +    ans[0] += 1 +    ans[1] += pen[i] +print((*ans))