import sys

from functools import reduce



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

ps = [r.split() for r in sys.stdin.read().split('\n') if r != '']

ps.sort(key=lambda t: int(t[0]))

log = []

for i in range(0, n):

    log.append([])

for j in range(0, m):

    i = int(ps[j][0])

    log[i-1].append(ps[j][1])

wacount = sum([l.index('AC') for l in [e for e in log if e.count('AC') > 0]])

print((len(list([e for e in log if e.count('AC') > 0])),

        wacount))
import sys

from functools import reduce



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

ps = [r.split() for r in sys.stdin.read().split('\n') if r != '']

log = []

for i in range(0, n):

    log.append([])

for j in range(0, m):

    i = int(ps[j][0])

    log[i-1].append(ps[j][1])

wacount = sum([l.index('AC') for l in [e for e in log if e.count('AC') > 0]])

print((len(list([e for e in log if e.count('AC') > 0])),

        wacount))
import sys
from functools import reduce

n, m = list(map(int, input().split()))
ps = [r.split() for r in sys.stdin.read().split("\n") if r != ""]
ps.sort(key=lambda t: int(t[0]))
log = []
for i in range(0, n):
    log.append([])
for j in range(0, m):
    i = int(ps[j][0])
    log[i - 1].append(ps[j][1])
wacount = sum([l.index("AC") for l in [e for e in log if e.count("AC") > 0]])
print((len(list([e for e in log if e.count("AC") > 0])), wacount))

import sys
from functools import reduce

n, m = list(map(int, input().split()))
ps = [r.split() for r in sys.stdin.read().split("\n") if r != ""]
log = []
for i in range(0, n):
    log.append([])
for j in range(0, m):
    i = int(ps[j][0])
    log[i - 1].append(ps[j][1])
wacount = sum([l.index("AC") for l in [e for e in log if e.count("AC") > 0]])
print((len(list([e for e in log if e.count("AC") > 0])), wacount))

-ps.sort(key=lambda t: int(t[0]))