n,m=list(map(int,input().split()))

l=[list(input().split()) for i in range(m)]

from collections import defaultdict

cnt_ac=defaultdict(lambda:0)

cnt_wa=defaultdict(lambda:0)



count_wa=0

count_ac=0

for i in range(m):

    if cnt_ac[l[i][0]]==0:

        

        if l[i][1]=='WA':

            cnt_wa[l[i][0]]+=1

        

        elif l[i][1]=='AC':

            cnt_ac[l[i][0]]=1

            count_ac+=1

            count_wa+=cnt_wa[l[i][0]]

print((count_ac,count_wa))

from collections import defaultdict

n,m=list(map(int,input().split()))

p,s=[],[]

for i in range(m):

    P,S=input().split()

    p.append(int(P))

    s.append(S)



pena=0

cnt_ac=defaultdict(lambda :0)

cnt_wa=defaultdict(lambda :0)

for x,y in zip(p,s):

    if cnt_ac[x]==0:

        if y=='AC':

            cnt_ac[x]=1

            pena+=cnt_wa[x]



        elif y=='WA':

            cnt_wa[x]+=1



print((sum(cnt_ac.values()),pena))

n, m = list(map(int, input().split()))
l = [list(input().split()) for i in range(m)]
from collections import defaultdict

cnt_ac = defaultdict(lambda: 0)
cnt_wa = defaultdict(lambda: 0)
count_wa = 0
count_ac = 0
for i in range(m):
    if cnt_ac[l[i][0]] == 0:
        if l[i][1] == "WA":
            cnt_wa[l[i][0]] += 1
        elif l[i][1] == "AC":
            cnt_ac[l[i][0]] = 1
            count_ac += 1
            count_wa += cnt_wa[l[i][0]]
print((count_ac, count_wa))

from collections import defaultdict

n, m = list(map(int, input().split()))
p, s = [], []
for i in range(m):
    P, S = input().split()
    p.append(int(P))
    s.append(S)
pena = 0
cnt_ac = defaultdict(lambda: 0)
cnt_wa = defaultdict(lambda: 0)
for x, y in zip(p, s):
    if cnt_ac[x] == 0:
        if y == "AC":
            cnt_ac[x] = 1
            pena += cnt_wa[x]
        elif y == "WA":
            cnt_wa[x] += 1
print((sum(cnt_ac.values()), pena))

-n, m = list(map(int, input().split())) -l = [list(input().split()) for i in range(m)] +n, m = list(map(int, input().split())) +p, s = [], [] +for i in range(m): +    P, S = input().split() +    p.append(int(P)) +    s.append(S) +pena = 0 -count_wa = 0 -count_ac = 0 -for i in range(m): -    if cnt_ac[l[i][0]] == 0: -        if l[i][1] == "WA": -            cnt_wa[l[i][0]] += 1 -        elif l[i][1] == "AC": -            cnt_ac[l[i][0]] = 1 -            count_ac += 1 -            count_wa += cnt_wa[l[i][0]] -print((count_ac, count_wa)) +for x, y in zip(p, s): +    if cnt_ac[x] == 0: +        if y == "AC": +            cnt_ac[x] = 1 +            pena += cnt_wa[x] +        elif y == "WA": +            cnt_wa[x] += 1 +print((sum(cnt_ac.values()), pena))