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



# AC = 0

# WA = 0

# PS = {}

# for i in range(M):

#     # print(PS)

#     p, S = input().split()

#     tmp = PS.get(p)

#     # if tmp != None:

#         # print("\t" + tmp)



#     if tmp != "AC":

#         if S == "AC":

#             AC += 1

#         elif S == "WA":

#             WA += 1

#         PS[p] = S



AC = [False] * N

WA = [0] * N



# print((AC))

# print(WA)



for _ in range(M):

    p, S = input().split()

    p = int(p)



    if AC[p-1] == False:

        if S == "AC":

            AC[p-1] = True

        else:

            WA[p-1] += 1

# print((AC))

# print(WA)

a = 0

w = 0

for i in range(N):

    if AC[i]:

        a += 1

        w += WA[i]



print((a, w))

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



AC = 0

WA = 0

PS = {}

for _ in range(M):

    p, S = input().split()

    tmp = PS.get(p)

    # print(PS)

    if tmp == None:

        if S == "AC":

            PS[p] = S

            AC += 1

        else:

            PS[p] = 1

    elif tmp != "AC":

        if S == "AC":

            PS[p] = S

            AC += 1

            WA += tmp

        else:

            PS[p] += 1

print((AC, WA))
N, M = list(map(int, input().split()))
# AC = 0
# WA = 0
# PS = {}
# for i in range(M):
#     # print(PS)
#     p, S = input().split()
#     tmp = PS.get(p)
#     # if tmp != None:
#         # print("\t" + tmp)
#     if tmp != "AC":
#         if S == "AC":
#             AC += 1
#         elif S == "WA":
#             WA += 1
#         PS[p] = S
AC = [False] * N
WA = [0] * N
# print((AC))
# print(WA)
for _ in range(M):
    p, S = input().split()
    p = int(p)
    if AC[p - 1] == False:
        if S == "AC":
            AC[p - 1] = True
        else:
            WA[p - 1] += 1
# print((AC))
# print(WA)
a = 0
w = 0
for i in range(N):
    if AC[i]:
        a += 1
        w += WA[i]
print((a, w))

N, M = list(map(int, input().split()))
AC = 0
WA = 0
PS = {}
for _ in range(M):
    p, S = input().split()
    tmp = PS.get(p)
    # print(PS)
    if tmp == None:
        if S == "AC":
            PS[p] = S
            AC += 1
        else:
            PS[p] = 1
    elif tmp != "AC":
        if S == "AC":
            PS[p] = S
            AC += 1
            WA += tmp
        else:
            PS[p] += 1
print((AC, WA))

-# AC = 0 -# WA = 0 -# PS = {} -# for i in range(M): -#     # print(PS) -#     p, S = input().split() -#     tmp = PS.get(p) -#     # if tmp != None: -#         # print("\t" + tmp) -#     if tmp != "AC": -#         if S == "AC": -#             AC += 1 -#         elif S == "WA": -#             WA += 1 -#         PS[p] = S -AC = [False] * N -WA = [0] * N -# print((AC)) -# print(WA) +AC = 0 +WA = 0 +PS = {} -    p = int(p) -    if AC[p - 1] == False: +    tmp = PS.get(p) +    # print(PS) +    if tmp == None: -            AC[p - 1] = True +            PS[p] = S +            AC += 1 -            WA[p - 1] += 1 -# print((AC)) -# print(WA) -a = 0 -w = 0 -for i in range(N): -    if AC[i]: -        a += 1 -        w += WA[i] -print((a, w)) +            PS[p] = 1 +    elif tmp != "AC": +        if S == "AC": +            PS[p] = S +            AC += 1 +            WA += tmp +        else: +            PS[p] += 1 +print((AC, WA))