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

p = [0] * M

S = [0] * M

for i in range(M):

    line = input().split()

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

    S[i] = line[1]



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

WA = [0 for _ in range(N)]

for i in range(M):

    if AC[p[i] - 1]:

        pass

    else:

        if S[i] == "AC":

            AC[p[i] - 1] = True

        else:

            WA[p[i] - 1] += 1



n_AC = sum(AC)

n_WA = 0

for i in range(N):

    if AC[i]:

        n_WA += WA[i]



print((" ".join([str(n_AC), str(n_WA)])))

import sys



input = sys.stdin.readline





def main():

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

    P = [0] * M

    S = [""] * M

    for i in range(M):

        PS = input().split()

        P[i], S[i] = int(PS[0]), PS[1]



    AC = [False] * (N + 1)

    WA = [0] * (N + 1)

    n_AC = 0

    n_WA = 0

    for p, s in zip(P, S):

        if AC[p]:

            continue

        if s == "AC":

            n_AC += 1

            AC[p] = True

            n_WA += WA[p]

        else:

            WA[p] += 1



    print((n_AC, n_WA))





if __name__ == "__main__":

    main()

N, M = list(map(int, input().split()))
p = [0] * M
S = [0] * M
for i in range(M):
    line = input().split()
    p[i] = int(line[0])
    S[i] = line[1]
AC = [False for _ in range(N)]
WA = [0 for _ in range(N)]
for i in range(M):
    if AC[p[i] - 1]:
        pass
    else:
        if S[i] == "AC":
            AC[p[i] - 1] = True
        else:
            WA[p[i] - 1] += 1
n_AC = sum(AC)
n_WA = 0
for i in range(N):
    if AC[i]:
        n_WA += WA[i]
print((" ".join([str(n_AC), str(n_WA)])))

import sys

input = sys.stdin.readline


def main():
    N, M = list(map(int, input().split()))
    P = [0] * M
    S = [""] * M
    for i in range(M):
        PS = input().split()
        P[i], S[i] = int(PS[0]), PS[1]
    AC = [False] * (N + 1)
    WA = [0] * (N + 1)
    n_AC = 0
    n_WA = 0
    for p, s in zip(P, S):
        if AC[p]:
            continue
        if s == "AC":
            n_AC += 1
            AC[p] = True
            n_WA += WA[p]
        else:
            WA[p] += 1
    print((n_AC, n_WA))


if __name__ == "__main__":
    main()

-N, M = list(map(int, input().split())) -p = [0] * M -S = [0] * M -for i in range(M): -    line = input().split() -    p[i] = int(line[0]) -    S[i] = line[1] -AC = [False for _ in range(N)] -WA = [0 for _ in range(N)] -for i in range(M): -    if AC[p[i] - 1]: -        pass -    else: -        if S[i] == "AC": -            AC[p[i] - 1] = True +import sys + +input = sys.stdin.readline + + +def main(): +    N, M = list(map(int, input().split())) +    P = [0] * M +    S = [""] * M +    for i in range(M): +        PS = input().split() +        P[i], S[i] = int(PS[0]), PS[1] +    AC = [False] * (N + 1) +    WA = [0] * (N + 1) +    n_AC = 0 +    n_WA = 0 +    for p, s in zip(P, S): +        if AC[p]: +            continue +        if s == "AC": +            n_AC += 1 +            AC[p] = True +            n_WA += WA[p] -            WA[p[i] - 1] += 1 -n_AC = sum(AC) -n_WA = 0 -for i in range(N): -    if AC[i]: -        n_WA += WA[i] -print((" ".join([str(n_AC), str(n_WA)]))) +            WA[p] += 1 +    print((n_AC, n_WA)) + + +if __name__ == "__main__": +    main()