def main():

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

    ac = 0

    wa = 0

    answer = ["C"] * N  # C: 適当な初期値

    for _ in range(M):

        ps = input().split(" ")

        p = int(ps[0]) - 1

        if not answer[p][-1] == "A":

            answer[p] = answer[p] + ps[1][0]

    if M > 0:

        for a in answer:

            if a[-1] == "A":

                ac += 1

                wa += (len(a) - 2)

    print((ac, wa))





if __name__ == '__main__':

    main()
def main():

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

    questions = [[0, False] for _ in range(n)]

    for _ in range(m):

        p, s = input().split()

        p = int(p) - 1

        if not questions[p][1]:

            if s == "WA":

                questions[p][0] += 1

            else:

                questions[p][1] = True

    ac = 0

    wa = 0

    for wa_num, is_accepted in questions:

        if is_accepted:

            ac += 1

            wa += wa_num

    print((ac, wa))





if __name__ == '__main__':

    main()



def main():
    N, M = list(map(int, input().split(" ")))
    ac = 0
    wa = 0
    answer = ["C"] * N  # C: 適当な初期値
    for _ in range(M):
        ps = input().split(" ")
        p = int(ps[0]) - 1
        if not answer[p][-1] == "A":
            answer[p] = answer[p] + ps[1][0]
    if M > 0:
        for a in answer:
            if a[-1] == "A":
                ac += 1
                wa += len(a) - 2
    print((ac, wa))


if __name__ == "__main__":
    main()

def main():
    n, m = list(map(int, input().split()))
    questions = [[0, False] for _ in range(n)]
    for _ in range(m):
        p, s = input().split()
        p = int(p) - 1
        if not questions[p][1]:
            if s == "WA":
                questions[p][0] += 1
            else:
                questions[p][1] = True
    ac = 0
    wa = 0
    for wa_num, is_accepted in questions:
        if is_accepted:
            ac += 1
            wa += wa_num
    print((ac, wa))


if __name__ == "__main__":
    main()

-    N, M = list(map(int, input().split(" "))) +    n, m = list(map(int, input().split())) +    questions = [[0, False] for _ in range(n)] +    for _ in range(m): +        p, s = input().split() +        p = int(p) - 1 +        if not questions[p][1]: +            if s == "WA": +                questions[p][0] += 1 +            else: +                questions[p][1] = True -    answer = ["C"] * N  # C: 適当な初期値 -    for _ in range(M): -        ps = input().split(" ") -        p = int(ps[0]) - 1 -        if not answer[p][-1] == "A": -            answer[p] = answer[p] + ps[1][0] -    if M > 0: -        for a in answer: -            if a[-1] == "A": -                ac += 1 -                wa += len(a) - 2 +    for wa_num, is_accepted in questions: +        if is_accepted: +            ac += 1 +            wa += wa_num