def main():

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

    ans_dict = dict() # {問題i : [ACしたかどうか、ACに関係なく累計WA数]}



    for _ in range(m):

        p, s = input().split()



        if p not in ans_dict: # 初見の場合

            if s == "AC": # 正解

                ans_dict[p] = [1, 0]

            else: # 不正解

                ans_dict[p] = [0, 1]

        else: # 初見じゃない場合

            if ans_dict[p][0] == 1: # 正解済み

                continue

            else: # 未正解

                if s == "AC":

                    ans_dict[p][0] = 1

                else:

                    ans_dict[p][1] += 1



    ac_count = 0

    wa_count = 0

    for item in list(ans_dict.items()):

        if item[1][0] == 1: # 正解済み

            ac_count += 1

            wa_count += item[1][1]



    print((ac_count, wa_count))





if __name__ == "__main__":

    main()

def main():

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

    ac_list = [0 for _ in range(n + 1)] # 1: 正解済 0: 未正解

    wa_list = [0 for _ in range(n + 1)] 



    for _ in range(m):

        p, s = input().split()

        p = int(p)



        if ac_list[p] == 1: # 正解済

            continue

        

        if s == "AC":

            ac_list[p] = 1

        else:

            wa_list[p] += 1



    ac_count = 0

    wa_count = 0

    for i in range(1, n + 1):

        if ac_list[i] == 1:

            ac_count += 1

            wa_count += wa_list[i]



    print((ac_count, wa_count))





if __name__ == "__main__":

    main()

def main():
    n, m = list(map(int, input().split()))
    ans_dict = dict()  # {問題i : [ACしたかどうか、ACに関係なく累計WA数]}
    for _ in range(m):
        p, s = input().split()
        if p not in ans_dict:  # 初見の場合
            if s == "AC":  # 正解
                ans_dict[p] = [1, 0]
            else:  # 不正解
                ans_dict[p] = [0, 1]
        else:  # 初見じゃない場合
            if ans_dict[p][0] == 1:  # 正解済み
                continue
            else:  # 未正解
                if s == "AC":
                    ans_dict[p][0] = 1
                else:
                    ans_dict[p][1] += 1
    ac_count = 0
    wa_count = 0
    for item in list(ans_dict.items()):
        if item[1][0] == 1:  # 正解済み
            ac_count += 1
            wa_count += item[1][1]
    print((ac_count, wa_count))


if __name__ == "__main__":
    main()

def main():
    n, m = list(map(int, input().split()))
    ac_list = [0 for _ in range(n + 1)]  # 1: 正解済 0: 未正解
    wa_list = [0 for _ in range(n + 1)]
    for _ in range(m):
        p, s = input().split()
        p = int(p)
        if ac_list[p] == 1:  # 正解済
            continue
        if s == "AC":
            ac_list[p] = 1
        else:
            wa_list[p] += 1
    ac_count = 0
    wa_count = 0
    for i in range(1, n + 1):
        if ac_list[i] == 1:
            ac_count += 1
            wa_count += wa_list[i]
    print((ac_count, wa_count))


if __name__ == "__main__":
    main()

-    ans_dict = dict()  # {問題i : [ACしたかどうか、ACに関係なく累計WA数]} +    ac_list = [0 for _ in range(n + 1)]  # 1: 正解済 0: 未正解 +    wa_list = [0 for _ in range(n + 1)] -        if p not in ans_dict:  # 初見の場合 -            if s == "AC":  # 正解 -                ans_dict[p] = [1, 0] -            else:  # 不正解 -                ans_dict[p] = [0, 1] -        else:  # 初見じゃない場合 -            if ans_dict[p][0] == 1:  # 正解済み -                continue -            else:  # 未正解 -                if s == "AC": -                    ans_dict[p][0] = 1 -                else: -                    ans_dict[p][1] += 1 +        p = int(p) +        if ac_list[p] == 1:  # 正解済 +            continue +        if s == "AC": +            ac_list[p] = 1 +        else: +            wa_list[p] += 1 -    for item in list(ans_dict.items()): -        if item[1][0] == 1:  # 正解済み +    for i in range(1, n + 1): +        if ac_list[i] == 1: -            wa_count += item[1][1] +            wa_count += wa_list[i]