def solved(p):

    return cwa[p] == -1





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



wa = 0

cwa = [0] * n

for _ in range(m):

    p, s = input().split()

    p = int(p) - 1

    if solved(p):

        continue

    if s == 'AC':

        wa += cwa[p]

        cwa[p] = -1

    else:

        cwa[p] += 1



ac = cwa.count(-1)

print((ac, wa))

def main():

    import sys

    input = sys.stdin.readline



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



    ac = [False] * N

    wa = [0] * N

    for _ in range(M):

        it = iter(input().split())

        p = int(next(it)) - 1

        s = next(it)

        if s == 'AC':

            ac[p] = True

        else:

            if not ac[p]:

                wa[p] += 1

    print((ac.count(True), sum(w for p, w in enumerate(wa) if ac[p])))





if __name__ == '__main__':

    main()

def solved(p):
    return cwa[p] == -1


n, m = list(map(int, input().split()))
wa = 0
cwa = [0] * n
for _ in range(m):
    p, s = input().split()
    p = int(p) - 1
    if solved(p):
        continue
    if s == "AC":
        wa += cwa[p]
        cwa[p] = -1
    else:
        cwa[p] += 1
ac = cwa.count(-1)
print((ac, wa))

def main():
    import sys

    input = sys.stdin.readline
    N, M = list(map(int, input().split()))
    ac = [False] * N
    wa = [0] * N
    for _ in range(M):
        it = iter(input().split())
        p = int(next(it)) - 1
        s = next(it)
        if s == "AC":
            ac[p] = True
        else:
            if not ac[p]:
                wa[p] += 1
    print((ac.count(True), sum(w for p, w in enumerate(wa) if ac[p])))


if __name__ == "__main__":
    main()

-def solved(p): -    return cwa[p] == -1 +def main(): +    import sys + +    input = sys.stdin.readline +    N, M = list(map(int, input().split())) +    ac = [False] * N +    wa = [0] * N +    for _ in range(M): +        it = iter(input().split()) +        p = int(next(it)) - 1 +        s = next(it) +        if s == "AC": +            ac[p] = True +        else: +            if not ac[p]: +                wa[p] += 1 +    print((ac.count(True), sum(w for p, w in enumerate(wa) if ac[p]))) -n, m = list(map(int, input().split())) -wa = 0 -cwa = [0] * n -for _ in range(m): -    p, s = input().split() -    p = int(p) - 1 -    if solved(p): -        continue -    if s == "AC": -        wa += cwa[p] -        cwa[p] = -1 -    else: -        cwa[p] += 1 -ac = cwa.count(-1) -print((ac, wa)) +if __name__ == "__main__": +    main()