import numpy as np



def main():

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

    PS = {}

    for i in range(M):

        row = input().split()

        row[0] = int(row[0])

        if row[0] not in PS:

            PS[row[0]] = [row[1]]

        else:

            PS[row[0]].append(row[1])



    n_correct = 0

    n_penalty = 0

    for p in PS:

        if 'AC' in PS[p]:

            n_correct += 1

            for result in PS[p]:

                if result == 'AC':

                    break

                if result == 'WA':

                    n_penalty += 1

    

    print(('{} {}'.format(n_correct, n_penalty)))

        





if __name__ == '__main__':

    main()
import numpy as np



def main():

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

    # PS = {}

    # for i in range(M):

    #     row = input().split()

    #     row[0] = int(row[0])

    #     if row[0] not in PS:

    #         PS[row[0]] = [row[1]]

    #     else:

    #         PS[row[0]].append(row[1])



    # n_correct = 0

    # n_penalty = 0

    # for p in PS:

    #     if 'AC' in PS[p]:

    #         n_correct += 1

    #         for result in PS[p]:

    #             if result == 'AC':

    #                 break

    #             if result == 'WA':

    #                 n_penalty += 1

    

    # print('{} {}'.format(n_correct, n_penalty))



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

    accepted = [False] * N

    penalties = [0] * N

    for _ in range(M):

        q, res = input().split()

        q = int(q) - 1

        if res[0] == 'A':

            accepted[q] = True

        elif res[0] == 'W' and not accepted[q]:

            penalties[q] += 1



    s_acc = 0

    s_pen = 0

    for i in range(N):

        if accepted[i]:

            s_acc += 1

            s_pen += penalties[i]



    print(('{} {}'.format(s_acc, s_pen)))

    



if __name__ == '__main__':

    main()
import numpy as np


def main():
    N, M = list(map(int, input().split()))
    PS = {}
    for i in range(M):
        row = input().split()
        row[0] = int(row[0])
        if row[0] not in PS:
            PS[row[0]] = [row[1]]
        else:
            PS[row[0]].append(row[1])
    n_correct = 0
    n_penalty = 0
    for p in PS:
        if "AC" in PS[p]:
            n_correct += 1
            for result in PS[p]:
                if result == "AC":
                    break
                if result == "WA":
                    n_penalty += 1
    print(("{} {}".format(n_correct, n_penalty)))


if __name__ == "__main__":
    main()

import numpy as np


def main():
    # N, M = map(int, input().split())
    # PS = {}
    # for i in range(M):
    #     row = input().split()
    #     row[0] = int(row[0])
    #     if row[0] not in PS:
    #         PS[row[0]] = [row[1]]
    #     else:
    #         PS[row[0]].append(row[1])
    # n_correct = 0
    # n_penalty = 0
    # for p in PS:
    #     if 'AC' in PS[p]:
    #         n_correct += 1
    #         for result in PS[p]:
    #             if result == 'AC':
    #                 break
    #             if result == 'WA':
    #                 n_penalty += 1
    # print('{} {}'.format(n_correct, n_penalty))
    N, M = list(map(int, input().split()))
    accepted = [False] * N
    penalties = [0] * N
    for _ in range(M):
        q, res = input().split()
        q = int(q) - 1
        if res[0] == "A":
            accepted[q] = True
        elif res[0] == "W" and not accepted[q]:
            penalties[q] += 1
    s_acc = 0
    s_pen = 0
    for i in range(N):
        if accepted[i]:
            s_acc += 1
            s_pen += penalties[i]
    print(("{} {}".format(s_acc, s_pen)))


if __name__ == "__main__":
    main()

+    # N, M = map(int, input().split()) +    # PS = {} +    # for i in range(M): +    #     row = input().split() +    #     row[0] = int(row[0]) +    #     if row[0] not in PS: +    #         PS[row[0]] = [row[1]] +    #     else: +    #         PS[row[0]].append(row[1]) +    # n_correct = 0 +    # n_penalty = 0 +    # for p in PS: +    #     if 'AC' in PS[p]: +    #         n_correct += 1 +    #         for result in PS[p]: +    #             if result == 'AC': +    #                 break +    #             if result == 'WA': +    #                 n_penalty += 1 +    # print('{} {}'.format(n_correct, n_penalty)) -    PS = {} -    for i in range(M): -        row = input().split() -        row[0] = int(row[0]) -        if row[0] not in PS: -            PS[row[0]] = [row[1]] -        else: -            PS[row[0]].append(row[1]) -    n_correct = 0 -    n_penalty = 0 -    for p in PS: -        if "AC" in PS[p]: -            n_correct += 1 -            for result in PS[p]: -                if result == "AC": -                    break -                if result == "WA": -                    n_penalty += 1 -    print(("{} {}".format(n_correct, n_penalty))) +    accepted = [False] * N +    penalties = [0] * N +    for _ in range(M): +        q, res = input().split() +        q = int(q) - 1 +        if res[0] == "A": +            accepted[q] = True +        elif res[0] == "W" and not accepted[q]: +            penalties[q] += 1 +    s_acc = 0 +    s_pen = 0 +    for i in range(N): +        if accepted[i]: +            s_acc += 1 +            s_pen += penalties[i] +    print(("{} {}".format(s_acc, s_pen)))