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



if m==0:

    print((0,0))

    import sys

    sys.exit()



p=[list(input().split()) for _ in range(m)]

correct=set([p[i][0] for i in range(m) if p[i][1]=='AC'])



sum_wa=0

data=[0]*n



for i in range(m):

    if p[i][0] in correct and data[int(p[i][0])-1]==0:

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

            sum_wa+=1

        else:

            data[int(p[i][0])-1]=1



print((sum(data),sum_wa))
n,m=list(map(int,input().split()))



data=[0]*n

s=set()



for i in range(m):

    p,a=input().split()

    p=int(p)-1

    if p in s:

        continue

    else:

        if a=='WA':

            data[p]-=1

        else:

            data[p]*=-1

            s.add(p)



print((len(s),sum([data[i] for i in range(n) if data[i]>0])))
n, m = list(map(int, input().split()))
if m == 0:
    print((0, 0))
    import sys

    sys.exit()
p = [list(input().split()) for _ in range(m)]
correct = set([p[i][0] for i in range(m) if p[i][1] == "AC"])
sum_wa = 0
data = [0] * n
for i in range(m):
    if p[i][0] in correct and data[int(p[i][0]) - 1] == 0:
        if p[i][1] == "WA":
            sum_wa += 1
        else:
            data[int(p[i][0]) - 1] = 1
print((sum(data), sum_wa))

n, m = list(map(int, input().split()))
data = [0] * n
s = set()
for i in range(m):
    p, a = input().split()
    p = int(p) - 1
    if p in s:
        continue
    else:
        if a == "WA":
            data[p] -= 1
        else:
            data[p] *= -1
            s.add(p)
print((len(s), sum([data[i] for i in range(n) if data[i] > 0])))

-if m == 0: -    print((0, 0)) -    import sys - -    sys.exit() -p = [list(input().split()) for _ in range(m)] -correct = set([p[i][0] for i in range(m) if p[i][1] == "AC"]) -sum_wa = 0 +s = set() -    if p[i][0] in correct and data[int(p[i][0]) - 1] == 0: -        if p[i][1] == "WA": -            sum_wa += 1 +    p, a = input().split() +    p = int(p) - 1 +    if p in s: +        continue +    else: +        if a == "WA": +            data[p] -= 1 -            data[int(p[i][0]) - 1] = 1 -print((sum(data), sum_wa)) +            data[p] *= -1 +            s.add(p) +print((len(s), sum([data[i] for i in range(n) if data[i] > 0])))