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

a=[]

for i in range(n):

    a.append([0,0])

b=[]

c=0

d=0

for i in range(m):

    b.append(list(input().split()))

    b[i][0]=int(b[i][0])

a=sorted(a,key=lambda x:x[0])

for i in range(m):

    if b[i][1]=='WA':

        if a[b[i][0]-1][0]==0:

            a[b[i][0]-1][1]+=1

    else:

        if a[b[i][0]-1][0]==0:

            a[b[i][0]-1][0]=1

for i in range(n):

    c+=a[i][0]

    if a[i][0]==1:

        d+=a[i][1]

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

w,l=0,[0]*n

for i in range(m):

    p,s=input().split()

    p=int(p)-1

    if s=='AC':

        w+=l[p]*(l[p]>=0)

        l[p]=-1

    else:

        l[p]+=(l[p]>=0)

print((l.count(-1),w))
n, m = list(map(int, input().split()))
a = []
for i in range(n):
    a.append([0, 0])
b = []
c = 0
d = 0
for i in range(m):
    b.append(list(input().split()))
    b[i][0] = int(b[i][0])
a = sorted(a, key=lambda x: x[0])
for i in range(m):
    if b[i][1] == "WA":
        if a[b[i][0] - 1][0] == 0:
            a[b[i][0] - 1][1] += 1
    else:
        if a[b[i][0] - 1][0] == 0:
            a[b[i][0] - 1][0] = 1
for i in range(n):
    c += a[i][0]
    if a[i][0] == 1:
        d += a[i][1]
print((c, d))

n, m = list(map(int, input().split()))
w, l = 0, [0] * n
for i in range(m):
    p, s = input().split()
    p = int(p) - 1
    if s == "AC":
        w += l[p] * (l[p] >= 0)
        l[p] = -1
    else:
        l[p] += l[p] >= 0
print((l.count(-1), w))

-a = [] -for i in range(n): -    a.append([0, 0]) -b = [] -c = 0 -d = 0 +w, l = 0, [0] * n -    b.append(list(input().split())) -    b[i][0] = int(b[i][0]) -a = sorted(a, key=lambda x: x[0]) -for i in range(m): -    if b[i][1] == "WA": -        if a[b[i][0] - 1][0] == 0: -            a[b[i][0] - 1][1] += 1 +    p, s = input().split() +    p = int(p) - 1 +    if s == "AC": +        w += l[p] * (l[p] >= 0) +        l[p] = -1 -        if a[b[i][0] - 1][0] == 0: -            a[b[i][0] - 1][0] = 1 -for i in range(n): -    c += a[i][0] -    if a[i][0] == 1: -        d += a[i][1] -print((c, d)) +        l[p] += l[p] >= 0 +print((l.count(-1), w))