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

AC=[0]*N

WA=[0]*N

for i in range(M):

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

    p=int(p)

    if s=="AC":

        AC[p-1]=1

    else:

        if AC[p-1]==0:

            WA[p-1]+=1



for i in range(N):

    if AC[i]==0:

        WA[i]=0



print((sum(AC),sum(WA)))


def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    N,M=MI()

    AC=[0]*N

    WA=[0]*N

    

    for _ in range(M):

        p,s=input().split()

        p=int(p)-1

        if s=="AC":

            AC[p]=1

        else:

            if AC[p]==0:

                WA[p]+=1

       

    acs=sum(AC)     

    was=0

    for i in range(N):

        was+=AC[i]*WA[i]

        

    print((acs,was))

        



main()

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

def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    N, M = MI()
    AC = [0] * N
    WA = [0] * N
    for _ in range(M):
        p, s = input().split()
        p = int(p) - 1
        if s == "AC":
            AC[p] = 1
        else:
            if AC[p] == 0:
                WA[p] += 1
    acs = sum(AC)
    was = 0
    for i in range(N):
        was += AC[i] * WA[i]
    print((acs, was))


main()

-N, M = list(map(int, input().split())) -AC = [0] * N -WA = [0] * N -for i in range(M): -    p, s = list(map(str, input().split())) -    p = int(p) -    if s == "AC": -        AC[p - 1] = 1 -    else: -        if AC[p - 1] == 0: -            WA[p - 1] += 1 -for i in range(N): -    if AC[i] == 0: -        WA[i] = 0 -print((sum(AC), sum(WA))) +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    N, M = MI() +    AC = [0] * N +    WA = [0] * N +    for _ in range(M): +        p, s = input().split() +        p = int(p) - 1 +        if s == "AC": +            AC[p] = 1 +        else: +            if AC[p] == 0: +                WA[p] += 1 +    acs = sum(AC) +    was = 0 +    for i in range(N): +        was += AC[i] * WA[i] +    print((acs, was)) + + +main()