n, m = [int(i) for i in input().split()]

p = [0] * m

s = [0] * m



ac = 0

wc = 0

wan = [0] * (n+1)

qj = [False] * (n+1)



for i in range(m):

    p[i], s[i] = input().split()

    p[i] = int(p[i])

    if not qj[p[i]]:

        if s[i] == 'AC':

            qj[p[i]] =  'True'

            ac += 1

            wc += wan[p[i]]

        else:

            wan[p[i]] += 1



print((ac, wc))
import sys



readline = sys.stdin.readline

MOD = 10 ** 9 + 7

INF = float('INF')

sys.setrecursionlimit(10 ** 5)





def main():

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

    AC = [False] * N

    cnt = [0] * N



    for _ in range(M):

        p, s = input().split()

        p = int(p)

        p -= 1

        if s == "AC":

            AC[p] = True

        else:

            if not AC[p]:

                cnt[p] += 1



    ans_a = 0

    ans_p = 0

    for i in range(N):

        if AC[i]:

            ans_a += 1

            ans_p += cnt[i]



    print((ans_a, ans_p))





if __name__ == '__main__':

    main()

n, m = [int(i) for i in input().split()]
p = [0] * m
s = [0] * m
ac = 0
wc = 0
wan = [0] * (n + 1)
qj = [False] * (n + 1)
for i in range(m):
    p[i], s[i] = input().split()
    p[i] = int(p[i])
    if not qj[p[i]]:
        if s[i] == "AC":
            qj[p[i]] = "True"
            ac += 1
            wc += wan[p[i]]
        else:
            wan[p[i]] += 1
print((ac, wc))

import sys

readline = sys.stdin.readline
MOD = 10**9 + 7
INF = float("INF")
sys.setrecursionlimit(10**5)


def main():
    N, M = list(map(int, readline().split()))
    AC = [False] * N
    cnt = [0] * N
    for _ in range(M):
        p, s = input().split()
        p = int(p)
        p -= 1
        if s == "AC":
            AC[p] = True
        else:
            if not AC[p]:
                cnt[p] += 1
    ans_a = 0
    ans_p = 0
    for i in range(N):
        if AC[i]:
            ans_a += 1
            ans_p += cnt[i]
    print((ans_a, ans_p))


if __name__ == "__main__":
    main()

-n, m = [int(i) for i in input().split()] -p = [0] * m -s = [0] * m -ac = 0 -wc = 0 -wan = [0] * (n + 1) -qj = [False] * (n + 1) -for i in range(m): -    p[i], s[i] = input().split() -    p[i] = int(p[i]) -    if not qj[p[i]]: -        if s[i] == "AC": -            qj[p[i]] = "True" -            ac += 1 -            wc += wan[p[i]] +import sys + +readline = sys.stdin.readline +MOD = 10**9 + 7 +INF = float("INF") +sys.setrecursionlimit(10**5) + + +def main(): +    N, M = list(map(int, readline().split())) +    AC = [False] * N +    cnt = [0] * N +    for _ in range(M): +        p, s = input().split() +        p = int(p) +        p -= 1 +        if s == "AC": +            AC[p] = True -            wan[p[i]] += 1 -print((ac, wc)) +            if not AC[p]: +                cnt[p] += 1 +    ans_a = 0 +    ans_p = 0 +    for i in range(N): +        if AC[i]: +            ans_a += 1 +            ans_p += cnt[i] +    print((ans_a, ans_p)) + + +if __name__ == "__main__": +    main()