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

ac = [False]*n

count = [0]*n

a=0

b=0

for _ in range(m):

    p,s = input().split()

    if s == 'AC':

        if ac[int(p)-1]==False:

            ac[int(p)-1]=True

            a+=1

            b+=count[int(p)-1]

    else:

        if ac[int(p)-1]==False:

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

            

print((str(a)+' '+str(b)))
n,m = list(map(int,input().split()))

ans_list = [False for _ in range(n+1)]

pe_list = [0 for _ in range(n+1)]

ac=0

pe=0

for _ in range(m):

    p,s = input().split()

    if not ans_list[int(p)]:

        if s == 'AC':

            ac+=1

            pe+=pe_list[int(p)]

            ans_list[int(p)]=True

        else:

            pe_list[int(p)]+=1

            

print((ac,pe))
n, m = list(map(int, input().split()))
ac = [False] * n
count = [0] * n
a = 0
b = 0
for _ in range(m):
    p, s = input().split()
    if s == "AC":
        if ac[int(p) - 1] == False:
            ac[int(p) - 1] = True
            a += 1
            b += count[int(p) - 1]
    else:
        if ac[int(p) - 1] == False:
            count[int(p) - 1] += 1
print((str(a) + " " + str(b)))

n, m = list(map(int, input().split()))
ans_list = [False for _ in range(n + 1)]
pe_list = [0 for _ in range(n + 1)]
ac = 0
pe = 0
for _ in range(m):
    p, s = input().split()
    if not ans_list[int(p)]:
        if s == "AC":
            ac += 1
            pe += pe_list[int(p)]
            ans_list[int(p)] = True
        else:
            pe_list[int(p)] += 1
print((ac, pe))

-ac = [False] * n -count = [0] * n -a = 0 -b = 0 +ans_list = [False for _ in range(n + 1)] +pe_list = [0 for _ in range(n + 1)] +ac = 0 +pe = 0 -    if s == "AC": -        if ac[int(p) - 1] == False: -            ac[int(p) - 1] = True -            a += 1 -            b += count[int(p) - 1] -    else: -        if ac[int(p) - 1] == False: -            count[int(p) - 1] += 1 -print((str(a) + " " + str(b))) +    if not ans_list[int(p)]: +        if s == "AC": +            ac += 1 +            pe += pe_list[int(p)] +            ans_list[int(p)] = True +        else: +            pe_list[int(p)] += 1 +print((ac, pe))