



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





p = []

s = []

ans = [0]*N

c_wa = [0]*N

pena = 0



for i in range(M):

    temp1, temp2 = input().strip().split(" ")

    p.append(int(temp1))

    s.append(str(temp2))

  



for j in range(M):

    

    if s[j] == "WA":

        if ans[p[j]-1] == 0:

            c_wa[p[j]-1] += 1

        elif ans[p[j]-1] == 1:

            pass

        

                

            

    elif s[j] == "AC":

        if ans[p[j]-1] == 0:

            ans[p[j]-1] += 1

        elif ans[p[j]-1] == 1:

            pass

        

for k in range(N):

    if ans[k] == 1:

        pena += c_wa[k]

    



            

print((sum(ans), pena))
N, M = list(map(int,input().split(" ")))



ans = [0]*N

wc_c = [0]*N

pena = 0



for i in range(M):

    p, s = input().split(" ")

    p = int(p) - 1

    s = str(s)

    

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

        ans[p] = 1

        pena += wc_c[p]

        

    elif s == "WA" and ans[p] == 0:

        wc_c[p] += 1

        

print((sum(ans), pena))

      

    
N, M = list(map(int, input().strip().split(" ")))
p = []
s = []
ans = [0] * N
c_wa = [0] * N
pena = 0
for i in range(M):
    temp1, temp2 = input().strip().split(" ")
    p.append(int(temp1))
    s.append(str(temp2))
for j in range(M):
    if s[j] == "WA":
        if ans[p[j] - 1] == 0:
            c_wa[p[j] - 1] += 1
        elif ans[p[j] - 1] == 1:
            pass
    elif s[j] == "AC":
        if ans[p[j] - 1] == 0:
            ans[p[j] - 1] += 1
        elif ans[p[j] - 1] == 1:
            pass
for k in range(N):
    if ans[k] == 1:
        pena += c_wa[k]
print((sum(ans), pena))

N, M = list(map(int, input().split(" ")))
ans = [0] * N
wc_c = [0] * N
pena = 0
for i in range(M):
    p, s = input().split(" ")
    p = int(p) - 1
    s = str(s)
    if s == "AC" and ans[p] == 0:
        ans[p] = 1
        pena += wc_c[p]
    elif s == "WA" and ans[p] == 0:
        wc_c[p] += 1
print((sum(ans), pena))

-N, M = list(map(int, input().strip().split(" "))) -p = [] -s = [] +N, M = list(map(int, input().split(" "))) -c_wa = [0] * N +wc_c = [0] * N -    temp1, temp2 = input().strip().split(" ") -    p.append(int(temp1)) -    s.append(str(temp2)) -for j in range(M): -    if s[j] == "WA": -        if ans[p[j] - 1] == 0: -            c_wa[p[j] - 1] += 1 -        elif ans[p[j] - 1] == 1: -            pass -    elif s[j] == "AC": -        if ans[p[j] - 1] == 0: -            ans[p[j] - 1] += 1 -        elif ans[p[j] - 1] == 1: -            pass -for k in range(N): -    if ans[k] == 1: -        pena += c_wa[k] +    p, s = input().split(" ") +    p = int(p) - 1 +    s = str(s) +    if s == "AC" and ans[p] == 0: +        ans[p] = 1 +        pena += wc_c[p] +    elif s == "WA" and ans[p] == 0: +        wc_c[p] += 1