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

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

C = {str(i):0 for i in range(1,N+1)}

D = {str(i):0 for i in range(1,N+1)}

for j in range(M):

    p,s = A[j]

    if s=="AC" and C[p]==0:

        C[p] += 1

wa = 0

for j in range(M):

    p,s = A[j]

    if s=="WA":

        if C[p]==1 and D[p]==0:

            wa += 1

    else:

        if D[p]==0:

            D[p] += 1

ac = 0

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

    ac += C[str(i)]

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

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

C = {str(i):0 for i in range(1,N+1)}

for i in range(M):

    p,s = A[i]

    if s=="AC":

        C[p] = 1

D = {str(i):0 for i in range(1,N+1)}

cnt = 0

for i in range(M):

    p,s = A[i]

    if s=="WA":

        if C[p]==1 and D[p]==0:

            cnt += 1

    else:

        D[p] = 1

ac = 0

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

    if C[str(i)]==1:

        ac += 1

print((ac,cnt))
N, M = list(map(int, input().split()))
A = [list(input().split()) for _ in range(M)]
C = {str(i): 0 for i in range(1, N + 1)}
D = {str(i): 0 for i in range(1, N + 1)}
for j in range(M):
    p, s = A[j]
    if s == "AC" and C[p] == 0:
        C[p] += 1
wa = 0
for j in range(M):
    p, s = A[j]
    if s == "WA":
        if C[p] == 1 and D[p] == 0:
            wa += 1
    else:
        if D[p] == 0:
            D[p] += 1
ac = 0
for i in range(1, N + 1):
    ac += C[str(i)]
print((ac, wa))

N, M = list(map(int, input().split()))
A = [list(input().split()) for _ in range(M)]
C = {str(i): 0 for i in range(1, N + 1)}
for i in range(M):
    p, s = A[i]
    if s == "AC":
        C[p] = 1
D = {str(i): 0 for i in range(1, N + 1)}
cnt = 0
for i in range(M):
    p, s = A[i]
    if s == "WA":
        if C[p] == 1 and D[p] == 0:
            cnt += 1
    else:
        D[p] = 1
ac = 0
for i in range(1, N + 1):
    if C[str(i)] == 1:
        ac += 1
print((ac, cnt))

+for i in range(M): +    p, s = A[i] +    if s == "AC": +        C[p] = 1 -for j in range(M): -    p, s = A[j] -    if s == "AC" and C[p] == 0: -        C[p] += 1 -wa = 0 -for j in range(M): -    p, s = A[j] +cnt = 0 +for i in range(M): +    p, s = A[i] -            wa += 1 +            cnt += 1 -        if D[p] == 0: -            D[p] += 1 +        D[p] = 1 -    ac += C[str(i)] -print((ac, wa)) +    if C[str(i)] == 1: +        ac += 1 +print((ac, cnt))