

def myAnswer(N:int,M:int,p:list,S:list) -> None:

   ac = 0

   wa = 0

   dic = {}

   for key,value in zip(p,S):

      if(key in list(dic.keys())):

         dic[key].append(value)

      else:

         dic[key] = [value]

   for values in list(dic.values()):

      if(("AC" in values)):

         for v in values:

            if(v == "AC"):

               ac+=1

               break

            else:

               wa+=1

   print((ac,wa))



def modelAnswer():

   tmp=1

def main():

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

   p =[]

   S = []

   for _ in range(M):

      tmp = list(map(str,input().split()))

      p.append(tmp[0])

      S.append(tmp[1])

   myAnswer(N,M,p[:],S[:])

if __name__ == '__main__':

   main()



def solve(N,M,P,S):

    counterAC = 0

    counterWA = 0

    dic = {key:"WA" for key in set(P)}

    counter = {key:0 for key in set(P)}

    for p,s in zip(P,S):

        if(dic[p] == "AC"):

            continue

        else:

            if(s == "AC"):

                counterAC += 1

                counterWA += counter[p]

                dic[p] = "AC"

            else:

                counter[p]+=1

    print((counterAC,counterWA))

def main():

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

    P = []

    S = []

    for _ in range(M):

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

        P.append(int(p))

        S.append(s)

    solve(N,M,P,S)

    # print(solve())



if __name__ == "__main__":

    main()

def myAnswer(N: int, M: int, p: list, S: list) -> None:
    ac = 0
    wa = 0
    dic = {}
    for key, value in zip(p, S):
        if key in list(dic.keys()):
            dic[key].append(value)
        else:
            dic[key] = [value]
    for values in list(dic.values()):
        if "AC" in values:
            for v in values:
                if v == "AC":
                    ac += 1
                    break
                else:
                    wa += 1
    print((ac, wa))


def modelAnswer():
    tmp = 1


def main():
    N, M = list(map(int, input().split()))
    p = []
    S = []
    for _ in range(M):
        tmp = list(map(str, input().split()))
        p.append(tmp[0])
        S.append(tmp[1])
    myAnswer(N, M, p[:], S[:])


if __name__ == "__main__":
    main()

def solve(N, M, P, S):
    counterAC = 0
    counterWA = 0
    dic = {key: "WA" for key in set(P)}
    counter = {key: 0 for key in set(P)}
    for p, s in zip(P, S):
        if dic[p] == "AC":
            continue
        else:
            if s == "AC":
                counterAC += 1
                counterWA += counter[p]
                dic[p] = "AC"
            else:
                counter[p] += 1
    print((counterAC, counterWA))


def main():
    N, M = list(map(int, input().split()))
    P = []
    S = []
    for _ in range(M):
        p, s = list(map(str, input().split()))
        P.append(int(p))
        S.append(s)
    solve(N, M, P, S)
    # print(solve())


if __name__ == "__main__":
    main()

-def myAnswer(N: int, M: int, p: list, S: list) -> None: -    ac = 0 -    wa = 0 -    dic = {} -    for key, value in zip(p, S): -        if key in list(dic.keys()): -            dic[key].append(value) +def solve(N, M, P, S): +    counterAC = 0 +    counterWA = 0 +    dic = {key: "WA" for key in set(P)} +    counter = {key: 0 for key in set(P)} +    for p, s in zip(P, S): +        if dic[p] == "AC": +            continue -            dic[key] = [value] -    for values in list(dic.values()): -        if "AC" in values: -            for v in values: -                if v == "AC": -                    ac += 1 -                    break -                else: -                    wa += 1 -    print((ac, wa)) - - -def modelAnswer(): -    tmp = 1 +            if s == "AC": +                counterAC += 1 +                counterWA += counter[p] +                dic[p] = "AC" +            else: +                counter[p] += 1 +    print((counterAC, counterWA)) -    p = [] +    P = [] -        tmp = list(map(str, input().split())) -        p.append(tmp[0]) -        S.append(tmp[1]) -    myAnswer(N, M, p[:], S[:]) +        p, s = list(map(str, input().split())) +        P.append(int(p)) +        S.append(s) +    solve(N, M, P, S) +    # print(solve())