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

import collections

d=collections.defaultdict(list)

for i in range(m):

    x,a=input().split()

    x=int(x)

    d[x].append(a)



ac=0

wa=0

for i in d:

    cnt=0

    for j in d[i]:

        if j=="WA":

            cnt+=1

        else:

            ac+=1

            wa+=cnt

            break

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

ac_list=[None]*n

wa_list=[0]*n

ans=0

for i in range(m):

    q,status=input().split()

    q=int(q)

    if status=="AC" and ac_list[q-1]==None:

        ac_list[q-1]=True

        ans+=wa_list[q-1]

    elif status=="WA" and ac_list[q-1]==None:

        wa_list[q-1]+=1

x=ac_list.count(True)

print((x,ans))
n, m = list(map(int, input().split()))
import collections

d = collections.defaultdict(list)
for i in range(m):
    x, a = input().split()
    x = int(x)
    d[x].append(a)
ac = 0
wa = 0
for i in d:
    cnt = 0
    for j in d[i]:
        if j == "WA":
            cnt += 1
        else:
            ac += 1
            wa += cnt
            break
print((ac, wa))

n, m = list(map(int, input().split()))
ac_list = [None] * n
wa_list = [0] * n
ans = 0
for i in range(m):
    q, status = input().split()
    q = int(q)
    if status == "AC" and ac_list[q - 1] == None:
        ac_list[q - 1] = True
        ans += wa_list[q - 1]
    elif status == "WA" and ac_list[q - 1] == None:
        wa_list[q - 1] += 1
x = ac_list.count(True)
print((x, ans))

-import collections - -d = collections.defaultdict(list) +ac_list = [None] * n +wa_list = [0] * n +ans = 0 -    x, a = input().split() -    x = int(x) -    d[x].append(a) -ac = 0 -wa = 0 -for i in d: -    cnt = 0 -    for j in d[i]: -        if j == "WA": -            cnt += 1 -        else: -            ac += 1 -            wa += cnt -            break -print((ac, wa)) +    q, status = input().split() +    q = int(q) +    if status == "AC" and ac_list[q - 1] == None: +        ac_list[q - 1] = True +        ans += wa_list[q - 1] +    elif status == "WA" and ac_list[q - 1] == None: +        wa_list[q - 1] += 1 +x = ac_list.count(True) +print((x, ans))