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



RES = []



for i in range(M):

    RES.append(list(input().split()))



WA = [0]*(M+N)

ACed = [0]*(N+M)

tmp_num = [0]*(M+N)

tmp = 0

for i in range(M):

    num = int(RES[i][0])

    if RES[i][1] == "WA" and not ACed[num]:

        tmp_num[num] += 1

    elif RES[i][1] == "WA" and ACed[num]:

        tmp += 1

    else:

        ACed[num] = 1

        WA[num] = tmp_num[num]



print(sum(ACed),end=" ")

print(sum(WA))

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

solved = [0]*(N+1)

penalty = [0]*(N+1)



ac = 0

wa = 0

for _ in range(M):

    a,b = input().split()

    a = int(a)



    if not solved[a]:

        if b == "AC":

            wa += penalty[a]

            solved[a] = 1

        else:

            penalty[a] += 1



print((sum(solved),wa))
N, M = map(int, input().split())
RES = []
for i in range(M):
    RES.append(list(input().split()))
WA = [0] * (M + N)
ACed = [0] * (N + M)
tmp_num = [0] * (M + N)
tmp = 0
for i in range(M):
    num = int(RES[i][0])
    if RES[i][1] == "WA" and not ACed[num]:
        tmp_num[num] += 1
    elif RES[i][1] == "WA" and ACed[num]:
        tmp += 1
    else:
        ACed[num] = 1
        WA[num] = tmp_num[num]
print(sum(ACed), end=" ")
print(sum(WA))

N, M = list(map(int, input().split()))
solved = [0] * (N + 1)
penalty = [0] * (N + 1)
ac = 0
wa = 0
for _ in range(M):
    a, b = input().split()
    a = int(a)
    if not solved[a]:
        if b == "AC":
            wa += penalty[a]
            solved[a] = 1
        else:
            penalty[a] += 1
print((sum(solved), wa))

-N, M = map(int, input().split()) -RES = [] -for i in range(M): -    RES.append(list(input().split())) -WA = [0] * (M + N) -ACed = [0] * (N + M) -tmp_num = [0] * (M + N) -tmp = 0 -for i in range(M): -    num = int(RES[i][0]) -    if RES[i][1] == "WA" and not ACed[num]: -        tmp_num[num] += 1 -    elif RES[i][1] == "WA" and ACed[num]: -        tmp += 1 -    else: -        ACed[num] = 1 -        WA[num] = tmp_num[num] -print(sum(ACed), end=" ") -print(sum(WA)) +N, M = list(map(int, input().split())) +solved = [0] * (N + 1) +penalty = [0] * (N + 1) +ac = 0 +wa = 0 +for _ in range(M): +    a, b = input().split() +    a = int(a) +    if not solved[a]: +        if b == "AC": +            wa += penalty[a] +            solved[a] = 1 +        else: +            penalty[a] += 1 +print((sum(solved), wa))