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



result = [0]*N

wa = 0

ac = 0



for i in range(M):

    p,s = [i for i in input().split(" ")]

    if result[int(p)-1] != -1:

        if s == 'AC':

            wa += result[int(p)-1]

            result[int(p)-1] = -1

            ac += 1

        else:

            result[int(p)-1] += 1

        

            



print(ac,wa,sep=' ')

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

ans = 0

pen = 0

w = [0]*(N+1)

ac = [False]*(N+1)

for _ in range(M):

    p, s = input().split()

    if s == "AC" and not ac[int(p)]:

        pen += w[int(p)]

        ac[int(p)] = True

        ans += 1

    elif s == "WA":

        w[int(p)] += 1

print((ans, pen))
N, M = [int(item) for item in input().split(" ")]
result = [0] * N
wa = 0
ac = 0
for i in range(M):
    p, s = [i for i in input().split(" ")]
    if result[int(p) - 1] != -1:
        if s == "AC":
            wa += result[int(p) - 1]
            result[int(p) - 1] = -1
            ac += 1
        else:
            result[int(p) - 1] += 1
print(ac, wa, sep=" ")

N, M = list(map(int, input().split()))
ans = 0
pen = 0
w = [0] * (N + 1)
ac = [False] * (N + 1)
for _ in range(M):
    p, s = input().split()
    if s == "AC" and not ac[int(p)]:
        pen += w[int(p)]
        ac[int(p)] = True
        ans += 1
    elif s == "WA":
        w[int(p)] += 1
print((ans, pen))

-N, M = [int(item) for item in input().split(" ")] -result = [0] * N -wa = 0 -ac = 0 -for i in range(M): -    p, s = [i for i in input().split(" ")] -    if result[int(p) - 1] != -1: -        if s == "AC": -            wa += result[int(p) - 1] -            result[int(p) - 1] = -1 -            ac += 1 -        else: -            result[int(p) - 1] += 1 -print(ac, wa, sep=" ") +N, M = list(map(int, input().split())) +ans = 0 +pen = 0 +w = [0] * (N + 1) +ac = [False] * (N + 1) +for _ in range(M): +    p, s = input().split() +    if s == "AC" and not ac[int(p)]: +        pen += w[int(p)] +        ac[int(p)] = True +        ans += 1 +    elif s == "WA": +        w[int(p)] += 1 +print((ans, pen))