# 誤読したか？



import sys

read = sys.stdin.readline





def read_ints():

    return list(map(int, read().split()))





def read_a_int():

    return int(read())





def read_matrix(H):

    '''

    H is number of rows

    '''

    return [list(map(int, read().split())) for _ in range(H)]





def read_map(H):

    '''

    H is number of rows

    文字列で与えられた盤面を読み取る用

    '''

    return [read()[:-1] for _ in range(H)]





def read_col(H, n_cols):

    '''

    H is number of rows

    n_cols is number of cols



    A列、B列が与えられるようなとき

    '''

    ret = [[] for _ in range(n_cols)]

    for _ in range(H):

        tmp = list(map(int, read().split()))

        for col in range(n_cols):

            ret[col].append(tmp[col])



    return ret





N, M = read_ints()

from collections import defaultdict

flgs = [False] * N  # N問をACしたか

n_wa_ls = [0] * N





for _ in range(M):

    p, s = input().split()

    p = int(p) - 1

    if flgs[p]:

        continue

    if s == 'AC':

        flgs[p] = True

    elif s == 'WA':

        n_wa_ls[p] += 1



n_wa = 0

for i in range(N):

    if flgs[i]:

        n_wa += n_wa_ls[i]



print((sum(flgs), n_wa))



import sys

sys.setrecursionlimit(1 << 25)

read = sys.stdin.readline

ra = range

enu = enumerate





def read_ints():

    return list(map(int, read().split()))





def read_a_int():

    return int(read())





def read_tuple(H):

    '''

    H is number of rows

    '''

    ret = []

    for _ in range(H):

        ret.append(tuple(map(int, read().split())))

    return ret





def read_col(H):

    '''

    H is number of rows

    A列、B列が与えられるようなとき

    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合

    '''

    ret = []

    for _ in range(H):

        ret.append(list(map(int, read().split())))

    return tuple(map(list, list(zip(*ret))))





def read_matrix(H):

    '''

    H is number of rows

    '''

    ret = []

    for _ in range(H):

        ret.append(list(map(int, read().split())))

    return ret

    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため





MOD = 10**9 + 7

INF = 2**31  # 2147483648 > 10**9

# default import

from collections import defaultdict, Counter, deque

from operator import itemgetter

from itertools import product, permutations, combinations

from bisect import bisect_left, bisect_right  # , insort_left, insort_right



# https://atcoder.jp/contests/abc151/tasks/abc151_c

N, M = read_ints()

is_ac = [False] * N

n_wa = [0] * N

for _ in ra(M):

    p, S = read().split()

    p = int(p) - 1

    if is_ac[p]:  # すでにACしてたら何もしない

        continue

    if S == 'WA':

        n_wa[p] += 1

    else:

        is_ac[p] = True

n_pena = 0

for ac, n in zip(is_ac, n_wa):

    if ac:

        n_pena += n



print((sum(is_ac), n_pena))

# 誤読したか？
import sys

read = sys.stdin.readline


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_matrix(H):
    """
    H is number of rows
    """
    return [list(map(int, read().split())) for _ in range(H)]


def read_map(H):
    """
    H is number of rows
    文字列で与えられた盤面を読み取る用
    """
    return [read()[:-1] for _ in range(H)]


def read_col(H, n_cols):
    """
    H is number of rows
    n_cols is number of cols
    A列、B列が与えられるようなとき
    """
    ret = [[] for _ in range(n_cols)]
    for _ in range(H):
        tmp = list(map(int, read().split()))
        for col in range(n_cols):
            ret[col].append(tmp[col])
    return ret


N, M = read_ints()
from collections import defaultdict

flgs = [False] * N  # N問をACしたか
n_wa_ls = [0] * N
for _ in range(M):
    p, s = input().split()
    p = int(p) - 1
    if flgs[p]:
        continue
    if s == "AC":
        flgs[p] = True
    elif s == "WA":
        n_wa_ls[p] += 1
n_wa = 0
for i in range(N):
    if flgs[i]:
        n_wa += n_wa_ls[i]
print((sum(flgs), n_wa))

import sys

sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    """
    H is number of rows
    """
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    """
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    """
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, list(zip(*ret))))


def read_matrix(H):
    """
    H is number of rows
    """
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right

# https://atcoder.jp/contests/abc151/tasks/abc151_c
N, M = read_ints()
is_ac = [False] * N
n_wa = [0] * N
for _ in ra(M):
    p, S = read().split()
    p = int(p) - 1
    if is_ac[p]:  # すでにACしてたら何もしない
        continue
    if S == "WA":
        n_wa[p] += 1
    else:
        is_ac[p] = True
n_pena = 0
for ac, n in zip(is_ac, n_wa):
    if ac:
        n_pena += n
print((sum(is_ac), n_pena))

-# 誤読したか？ +sys.setrecursionlimit(1 << 25) +ra = range +enu = enumerate +def read_tuple(H): +    """ +    H is number of rows +    """ +    ret = [] +    for _ in range(H): +        ret.append(tuple(map(int, read().split()))) +    return ret + + +def read_col(H): +    """ +    H is number of rows +    A列、B列が与えられるようなとき +    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合 +    """ +    ret = [] +    for _ in range(H): +        ret.append(list(map(int, read().split()))) +    return tuple(map(list, list(zip(*ret)))) + + -    return [list(map(int, read().split())) for _ in range(H)] +    ret = [] +    for _ in range(H): +        ret.append(list(map(int, read().split()))) +    return ret +    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため -def read_map(H): -    """ -    H is number of rows -    文字列で与えられた盤面を読み取る用 -    """ -    return [read()[:-1] for _ in range(H)] +MOD = 10**9 + 7 +INF = 2**31  # 2147483648 > 10**9 +# default import +from collections import defaultdict, Counter, deque +from operator import itemgetter +from itertools import product, permutations, combinations +from bisect import bisect_left, bisect_right  # , insort_left, insort_right - -def read_col(H, n_cols): -    """ -    H is number of rows -    n_cols is number of cols -    A列、B列が与えられるようなとき -    """ -    ret = [[] for _ in range(n_cols)] -    for _ in range(H): -        tmp = list(map(int, read().split())) -        for col in range(n_cols): -            ret[col].append(tmp[col]) -    return ret - - +# https://atcoder.jp/contests/abc151/tasks/abc151_c -from collections import defaultdict - -flgs = [False] * N  # N問をACしたか -n_wa_ls = [0] * N -for _ in range(M): -    p, s = input().split() +is_ac = [False] * N +n_wa = [0] * N +for _ in ra(M): +    p, S = read().split() -    if flgs[p]: +    if is_ac[p]:  # すでにACしてたら何もしない -    if s == "AC": -        flgs[p] = True -    elif s == "WA": -        n_wa_ls[p] += 1 -n_wa = 0 -for i in range(N): -    if flgs[i]: -        n_wa += n_wa_ls[i] -print((sum(flgs), n_wa)) +    if S == "WA": +        n_wa[p] += 1 +    else: +        is_ac[p] = True +n_pena = 0 +for ac, n in zip(is_ac, n_wa): +    if ac: +        n_pena += n +print((sum(is_ac), n_pena))