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



AC=[0]*N

WA=[0]*N

ac=0

wa=0



for i in range(M):

    p,s=list(map(str,input().split()))

    P=int(p)

    if s=="AC":

        if AC[P-1]!=P:

            AC[P-1]+=P

            ac+=1

            wa+=WA[P-1]

    else:

        if AC[P-1]!=P:

            WA[P-1]+=1



print((ac,wa))
N,M=list(map(int,input().split()))



AC={}

WA={}

pe=0

ac=0



for i in range(M):

    p,S=list(map(str,input().split()))

    if S=="AC":

        if p in list(AC.keys()):

            pass

        else:

            AC[p]=1

            if p in list(WA.keys()):

                pe+=WA[p]

            ac+=1

    else:

        if p in list(WA.keys()):

            WA[p]+=1

        else:

            WA[p]=1

print((ac,pe))
N, M = list(map(int, input().split()))
AC = [0] * N
WA = [0] * N
ac = 0
wa = 0
for i in range(M):
    p, s = list(map(str, input().split()))
    P = int(p)
    if s == "AC":
        if AC[P - 1] != P:
            AC[P - 1] += P
            ac += 1
            wa += WA[P - 1]
    else:
        if AC[P - 1] != P:
            WA[P - 1] += 1
print((ac, wa))

N, M = list(map(int, input().split()))
AC = {}
WA = {}
pe = 0
ac = 0
for i in range(M):
    p, S = list(map(str, input().split()))
    if S == "AC":
        if p in list(AC.keys()):
            pass
        else:
            AC[p] = 1
            if p in list(WA.keys()):
                pe += WA[p]
            ac += 1
    else:
        if p in list(WA.keys()):
            WA[p] += 1
        else:
            WA[p] = 1
print((ac, pe))

-AC = [0] * N -WA = [0] * N +AC = {} +WA = {} +pe = 0 -wa = 0 -    p, s = list(map(str, input().split())) -    P = int(p) -    if s == "AC": -        if AC[P - 1] != P: -            AC[P - 1] += P +    p, S = list(map(str, input().split())) +    if S == "AC": +        if p in list(AC.keys()): +            pass +        else: +            AC[p] = 1 +            if p in list(WA.keys()): +                pe += WA[p] -            wa += WA[P - 1] -        if AC[P - 1] != P: -            WA[P - 1] += 1 -print((ac, wa)) +        if p in list(WA.keys()): +            WA[p] += 1 +        else: +            WA[p] = 1 +print((ac, pe))