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

d={} #正解の辞書

e={} #誤答の辞書

f={} #ペナの辞書

for _ in range(M):

    p,s=input().split()

    d.setdefault(p,0)

    e.setdefault(p,0)

    f.setdefault(p,0)

    if s=="WA" and d[p]==0:

        e[p]+=1

    elif s=="AC":

        d[p]=1

        f[p]=e[p]



print((sum(d.values()),sum(f.values())))



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

d={} #正解の辞書

e={} #誤答の辞書

f={} #ペナの辞書

for _ in range(M):

    p,s=input().split()

    d.setdefault(p,0)

    e.setdefault(p,0)

    #f.setdefault(p,0)

    if s=="WA" and d[p]==0:

        e[p]+=1

    elif s=="AC":

        d[p]=1

        f[p]=e[p]



print((sum(d.values()),sum(f.values())))



N, M = list(map(int, input().split()))
d = {}  # 正解の辞書
e = {}  # 誤答の辞書
f = {}  # ペナの辞書
for _ in range(M):
    p, s = input().split()
    d.setdefault(p, 0)
    e.setdefault(p, 0)
    f.setdefault(p, 0)
    if s == "WA" and d[p] == 0:
        e[p] += 1
    elif s == "AC":
        d[p] = 1
        f[p] = e[p]
print((sum(d.values()), sum(f.values())))

N, M = list(map(int, input().split()))
d = {}  # 正解の辞書
e = {}  # 誤答の辞書
f = {}  # ペナの辞書
for _ in range(M):
    p, s = input().split()
    d.setdefault(p, 0)
    e.setdefault(p, 0)
    # f.setdefault(p,0)
    if s == "WA" and d[p] == 0:
        e[p] += 1
    elif s == "AC":
        d[p] = 1
        f[p] = e[p]
print((sum(d.values()), sum(f.values())))

-    f.setdefault(p, 0) +    # f.setdefault(p,0)