from collections import defaultdict as dic

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

ac = 0

pena = 0

d = dic(list)

for i in range(m):

    pi, si = input().split()

    d[pi].append(si)



for (k, v) in list(d.items()):

    pe = 0

    flag = False

    for aw in v:

        if aw == 'WA':

            pe += 1

        else:

            ac += 1

            flag = True

            break



    if flag:

        pena += pe



print((ac, pena))

# -*- coding: utf-8 -*-

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

ck = set()

pe = 0

ac = 0

penalty = 0

cp = [0] * (n+1)

for i in range(m):

    p, s = input().split()

    p = int(p)

    if p in ck:

        continue



    if s == 'WA':

        cp[p] += 1

    else:

        penalty += cp[p]

        pe = 0

        ac += 1

        ck.add(p)



print((ac, penalty))

from collections import defaultdict as dic

n, m = list(map(int, input().split()))
ac = 0
pena = 0
d = dic(list)
for i in range(m):
    pi, si = input().split()
    d[pi].append(si)
for (k, v) in list(d.items()):
    pe = 0
    flag = False
    for aw in v:
        if aw == "WA":
            pe += 1
        else:
            ac += 1
            flag = True
            break
    if flag:
        pena += pe
print((ac, pena))

# -*- coding: utf-8 -*-
n, m = list(map(int, input().split()))
ck = set()
pe = 0
ac = 0
penalty = 0
cp = [0] * (n + 1)
for i in range(m):
    p, s = input().split()
    p = int(p)
    if p in ck:
        continue
    if s == "WA":
        cp[p] += 1
    else:
        penalty += cp[p]
        pe = 0
        ac += 1
        ck.add(p)
print((ac, penalty))

-from collections import defaultdict as dic - +# -*- coding: utf-8 -*- +ck = set() +pe = 0 -pena = 0 -d = dic(list) +penalty = 0 +cp = [0] * (n + 1) -    pi, si = input().split() -    d[pi].append(si) -for (k, v) in list(d.items()): -    pe = 0 -    flag = False -    for aw in v: -        if aw == "WA": -            pe += 1 -        else: -            ac += 1 -            flag = True -            break -    if flag: -        pena += pe -print((ac, pena)) +    p, s = input().split() +    p = int(p) +    if p in ck: +        continue +    if s == "WA": +        cp[p] += 1 +    else: +        penalty += cp[p] +        pe = 0 +        ac += 1 +        ck.add(p) +print((ac, penalty))