def c_welcome_to_atcoder():

    N, M = [int(i) for i in input().split()]

    Results = []

    for _ in range(M):

        p, s = input().split()

        Results.append((int(p), s))



    count_wa = [0] * (N + 1)

    is_already_ac = [False] * (N + 1)



    for p, s in Results:

        if is_already_ac[p]:

            continue



        if s == 'AC':

            is_already_ac[p] = True

        elif s == 'WA':

            count_wa[p] += 1



    ans_ac = 0

    ans_wa = 0

    for ac, wa in zip(is_already_ac, count_wa):

        if ac:

            ans_ac += 1

            ans_wa += wa

    return '{} {}'.format(ans_ac, ans_wa)



print((c_welcome_to_atcoder()))
def c_welcome_to_atcoder():

    N, M = [int(i) for i in input().split()]



    count_wa = [0] * (N + 1)

    is_already_ac = [False] * (N + 1)



    for _ in range(M):

        p, s = input().split()

        p = int(p)

        if is_already_ac[p]:

            continue

        if s == 'AC':

            is_already_ac[p] = True

        elif s == 'WA':

            count_wa[p] += 1



    accepted, wrong = 0, 0

    for ac, wa in zip(is_already_ac, count_wa):

        if ac:

            accepted += 1

            wrong += wa

    return '{} {}'.format(accepted, wrong)



print((c_welcome_to_atcoder()))
def c_welcome_to_atcoder():
    N, M = [int(i) for i in input().split()]
    Results = []
    for _ in range(M):
        p, s = input().split()
        Results.append((int(p), s))
    count_wa = [0] * (N + 1)
    is_already_ac = [False] * (N + 1)
    for p, s in Results:
        if is_already_ac[p]:
            continue
        if s == "AC":
            is_already_ac[p] = True
        elif s == "WA":
            count_wa[p] += 1
    ans_ac = 0
    ans_wa = 0
    for ac, wa in zip(is_already_ac, count_wa):
        if ac:
            ans_ac += 1
            ans_wa += wa
    return "{} {}".format(ans_ac, ans_wa)


print((c_welcome_to_atcoder()))

def c_welcome_to_atcoder():
    N, M = [int(i) for i in input().split()]
    count_wa = [0] * (N + 1)
    is_already_ac = [False] * (N + 1)
    for _ in range(M):
        p, s = input().split()
        p = int(p)
        if is_already_ac[p]:
            continue
        if s == "AC":
            is_already_ac[p] = True
        elif s == "WA":
            count_wa[p] += 1
    accepted, wrong = 0, 0
    for ac, wa in zip(is_already_ac, count_wa):
        if ac:
            accepted += 1
            wrong += wa
    return "{} {}".format(accepted, wrong)


print((c_welcome_to_atcoder()))

-    Results = [] +    count_wa = [0] * (N + 1) +    is_already_ac = [False] * (N + 1) -        Results.append((int(p), s)) -    count_wa = [0] * (N + 1) -    is_already_ac = [False] * (N + 1) -    for p, s in Results: +        p = int(p) -    ans_ac = 0 -    ans_wa = 0 +    accepted, wrong = 0, 0 -            ans_ac += 1 -            ans_wa += wa -    return "{} {}".format(ans_ac, ans_wa) +            accepted += 1 +            wrong += wa +    return "{} {}".format(accepted, wrong)