from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,pprint,fractions

sys.setrecursionlimit(10**8)

mod = 10**9+7

mod2 = 998244353

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



n,m = inpl()

sc = [input().split() for i in range(m)]

ac = 0

pena = 0

stpe = [0] * (n+1)

prob = [False] * (n+1)

for s,c in sc:

    s = int(s)

    if prob[s]:

        continue

    else:

        if c == 'AC':

            prob[s] = True

            ac += 1

            pena += stpe[s]

            stpe[s] = 0

        else:

            stpe[s] += 1

print((ac,pena))
from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

def inpl(): return list(map(int, sys.stdin.readline().split()))



n,m = inpl()

a = [False] * (n+1)

cnt = [0] * (n+1)

for _ in range(m):

    x,y = input().split()

    x = int(x)

    if y == 'AC':

        a[x] = True

    else:

        if not a[x]:

            cnt[x] += 1

pena = 0

for i in range(1,n+1):

    if a[i]: pena += cnt[i]

print((sum(a), pena))
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, pprint, fractions

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
mod2 = 998244353
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


n, m = inpl()
sc = [input().split() for i in range(m)]
ac = 0
pena = 0
stpe = [0] * (n + 1)
prob = [False] * (n + 1)
for s, c in sc:
    s = int(s)
    if prob[s]:
        continue
    else:
        if c == "AC":
            prob[s] = True
            ac += 1
            pena += stpe[s]
            stpe[s] = 0
        else:
            stpe[s] += 1
print((ac, pena))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


def inpl():
    return list(map(int, sys.stdin.readline().split()))


n, m = inpl()
a = [False] * (n + 1)
cnt = [0] * (n + 1)
for _ in range(m):
    x, y = input().split()
    x = int(x)
    if y == "AC":
        a[x] = True
    else:
        if not a[x]:
            cnt[x] += 1
pena = 0
for i in range(1, n + 1):
    if a[i]:
        pena += cnt[i]
print((sum(a), pena))

-from heapq import heappop, heappush, heapify -import sys, bisect, math, itertools, pprint, fractions +from heapq import heappop, heappush +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint -mod2 = 998244353 -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - -sc = [input().split() for i in range(m)] -ac = 0 +a = [False] * (n + 1) +cnt = [0] * (n + 1) +for _ in range(m): +    x, y = input().split() +    x = int(x) +    if y == "AC": +        a[x] = True +    else: +        if not a[x]: +            cnt[x] += 1 -stpe = [0] * (n + 1) -prob = [False] * (n + 1) -for s, c in sc: -    s = int(s) -    if prob[s]: -        continue -    else: -        if c == "AC": -            prob[s] = True -            ac += 1 -            pena += stpe[s] -            stpe[s] = 0 -        else: -            stpe[s] += 1 -print((ac, pena)) +for i in range(1, n + 1): +    if a[i]: +        pena += cnt[i] +print((sum(a), pena))