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

pen = [0] * N

AC = [False] * N

for _ in range(M):

    p, s = input().split()

    if s == "AC": AC[int(p) - 1] = True

    else:

        if AC[int(p) - 1] == False : pen[int(p) - 1] += 1

ACcount = AC.count(True)

Pcount = 0

for i in range(N):

    if AC[i]: Pcount += pen[i]

print((ACcount, Pcount))
import sys



def solve():

    input = sys.stdin.readline

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

    penalty = [0] * N

    accepted = [False for _ in range(N)] 

    totalPenalty = 0

    totalAccepted = 0

    for _ in range(M):

        p, s = list(map(str, input().strip("\n").split()))

        if s == "WA" and not accepted[int(p) - 1]: penalty[int(p) - 1] += 1

        else:

            if not accepted[int(p) - 1]:

                accepted[int(p) - 1] = True

                totalAccepted += 1

                totalPenalty += penalty[int(p) - 1]

    print((totalAccepted, totalPenalty))



    return 0



if __name__ == "__main__":

    solve()
N, M = list(map(int, input().split()))
pen = [0] * N
AC = [False] * N
for _ in range(M):
    p, s = input().split()
    if s == "AC":
        AC[int(p) - 1] = True
    else:
        if AC[int(p) - 1] == False:
            pen[int(p) - 1] += 1
ACcount = AC.count(True)
Pcount = 0
for i in range(N):
    if AC[i]:
        Pcount += pen[i]
print((ACcount, Pcount))

import sys


def solve():
    input = sys.stdin.readline
    N, M = list(map(int, input().split()))
    penalty = [0] * N
    accepted = [False for _ in range(N)]
    totalPenalty = 0
    totalAccepted = 0
    for _ in range(M):
        p, s = list(map(str, input().strip("\n").split()))
        if s == "WA" and not accepted[int(p) - 1]:
            penalty[int(p) - 1] += 1
        else:
            if not accepted[int(p) - 1]:
                accepted[int(p) - 1] = True
                totalAccepted += 1
                totalPenalty += penalty[int(p) - 1]
    print((totalAccepted, totalPenalty))
    return 0


if __name__ == "__main__":
    solve()

-N, M = list(map(int, input().split())) -pen = [0] * N -AC = [False] * N -for _ in range(M): -    p, s = input().split() -    if s == "AC": -        AC[int(p) - 1] = True -    else: -        if AC[int(p) - 1] == False: -            pen[int(p) - 1] += 1 -ACcount = AC.count(True) -Pcount = 0 -for i in range(N): -    if AC[i]: -        Pcount += pen[i] -print((ACcount, Pcount)) +import sys + + +def solve(): +    input = sys.stdin.readline +    N, M = list(map(int, input().split())) +    penalty = [0] * N +    accepted = [False for _ in range(N)] +    totalPenalty = 0 +    totalAccepted = 0 +    for _ in range(M): +        p, s = list(map(str, input().strip("\n").split())) +        if s == "WA" and not accepted[int(p) - 1]: +            penalty[int(p) - 1] += 1 +        else: +            if not accepted[int(p) - 1]: +                accepted[int(p) - 1] = True +                totalAccepted += 1 +                totalPenalty += penalty[int(p) - 1] +    print((totalAccepted, totalPenalty)) +    return 0 + + +if __name__ == "__main__": +    solve()