def solve():

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

    WAnum = 0

    ACnum = 0

    WA = [0]*(N+1)

    AC = [False]*(N+1)



    for _ in range(M):

        p, S = list(map(str, input().split()))

        p = int(p)

        if AC[p] == True:

            continue

        if S == 'AC':

            AC[p] = True

            ACnum += 1

            WAnum += WA[p]

        elif S == 'WA':

            WA[p] += 1

        #print(AC, WA)

    #print(AC,WA)

    print((ACnum, WAnum))



solve()
import sys, heapq

from collections import defaultdict

from itertools import product, permutations, combinations

from bisect import bisect_left # bisect(list, value) -> index



sys.setrecursionlimit(10**7)

def input():

    return sys.stdin.readline()[:-1]



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

pS = [list(input().split()) for _ in range(M)]



ac_num = defaultdict(int) # number of AC : dict

wa_num = defaultdict(int) # number of WA : dict

wass = 0 # number of WA : int

for ps in pS:

    p, S = int(ps[0]), ps[1]

    # 一度問題pがACなら飛ばす

    if ac_num[p] == 1:

        continue

    else:

        if S == 'AC':

            ac_num[p] = 1

            # ACになるまでにWAになった数を記録

            wass += wa_num[p]

        elif S == 'WA':

            wa_num[p] += 1

    #print(ac_num, wa_num)



print((sum(list(ac_num.values())), wass))
def solve():
    N, M = list(map(int, input().split()))
    WAnum = 0
    ACnum = 0
    WA = [0] * (N + 1)
    AC = [False] * (N + 1)
    for _ in range(M):
        p, S = list(map(str, input().split()))
        p = int(p)
        if AC[p] == True:
            continue
        if S == "AC":
            AC[p] = True
            ACnum += 1
            WAnum += WA[p]
        elif S == "WA":
            WA[p] += 1
        # print(AC, WA)
    # print(AC,WA)
    print((ACnum, WAnum))


solve()

import sys, heapq
from collections import defaultdict
from itertools import product, permutations, combinations
from bisect import bisect_left  # bisect(list, value) -> index

sys.setrecursionlimit(10**7)


def input():
    return sys.stdin.readline()[:-1]


N, M = list(map(int, input().split()))
pS = [list(input().split()) for _ in range(M)]
ac_num = defaultdict(int)  # number of AC : dict
wa_num = defaultdict(int)  # number of WA : dict
wass = 0  # number of WA : int
for ps in pS:
    p, S = int(ps[0]), ps[1]
    # 一度問題pがACなら飛ばす
    if ac_num[p] == 1:
        continue
    else:
        if S == "AC":
            ac_num[p] = 1
            # ACになるまでにWAになった数を記録
            wass += wa_num[p]
        elif S == "WA":
            wa_num[p] += 1
    # print(ac_num, wa_num)
print((sum(list(ac_num.values())), wass))

-def solve(): -    N, M = list(map(int, input().split())) -    WAnum = 0 -    ACnum = 0 -    WA = [0] * (N + 1) -    AC = [False] * (N + 1) -    for _ in range(M): -        p, S = list(map(str, input().split())) -        p = int(p) -        if AC[p] == True: -            continue -        if S == "AC": -            AC[p] = True -            ACnum += 1 -            WAnum += WA[p] -        elif S == "WA": -            WA[p] += 1 -        # print(AC, WA) -    # print(AC,WA) -    print((ACnum, WAnum)) +import sys, heapq +from collections import defaultdict +from itertools import product, permutations, combinations +from bisect import bisect_left  # bisect(list, value) -> index + +sys.setrecursionlimit(10**7) -solve() +def input(): +    return sys.stdin.readline()[:-1] + + +N, M = list(map(int, input().split())) +pS = [list(input().split()) for _ in range(M)] +ac_num = defaultdict(int)  # number of AC : dict +wa_num = defaultdict(int)  # number of WA : dict +wass = 0  # number of WA : int +for ps in pS: +    p, S = int(ps[0]), ps[1] +    # 一度問題pがACなら飛ばす +    if ac_num[p] == 1: +        continue +    else: +        if S == "AC": +            ac_num[p] = 1 +            # ACになるまでにWAになった数を記録 +            wass += wa_num[p] +        elif S == "WA": +            wa_num[p] += 1 +    # print(ac_num, wa_num) +print((sum(list(ac_num.values())), wass))