import sys

def input():

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

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

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

li=[[0,0] for i in range(n+1)] 

wa=0

ans=0

# print(ps)

for i in range(m):

    if li[int(ps[i][0])][0]==0:

        if ps[i][1]=="AC":

            li[int(ps[i][0])][0]+=1

        else:

            li[int(ps[i][0])][1]+=1

    else:

        continue

for i in range(n+1):

    if li[i][0]==0:

        continue

    else:

        ans+=1

        wa+=li[i][1]

print(ans)

print(wa)
import bisect, copy, heapq, math, sys

from collections import *

from functools import lru_cache

from itertools import accumulate, combinations, permutations, product

def input():

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

def ruiseki(lst):

    return [0]+list(accumulate(lst))

def celi(a,b):

    return -(-a//b)

sys.setrecursionlimit(5000000)

mod=pow(10,9)+7

al=[chr(ord('a') + i) for i in range(26)]

direction=[[1,0],[0,1],[-1,0],[0,-1]]



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

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



dic={}

anslst=[0]*n

for i in range(m):

    p,s=ps[i]

    if s=="AC":

        dic[p]=1

    else:

        if p in dic:

            continue

        else:

            anslst[int(p)-1]+=1





ans=0

for i in list(dic.keys()):

    ans+=anslst[int(i)-1]

print((len(dic),ans))
import sys


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


n, m = list(map(int, input().split()))
ps = [list(input().split()) for i in range(m)]
li = [[0, 0] for i in range(n + 1)]
wa = 0
ans = 0
# print(ps)
for i in range(m):
    if li[int(ps[i][0])][0] == 0:
        if ps[i][1] == "AC":
            li[int(ps[i][0])][0] += 1
        else:
            li[int(ps[i][0])][1] += 1
    else:
        continue
for i in range(n + 1):
    if li[i][0] == 0:
        continue
    else:
        ans += 1
        wa += li[i][1]
print(ans)
print(wa)

import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product


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


def ruiseki(lst):
    return [0] + list(accumulate(lst))


def celi(a, b):
    return -(-a // b)


sys.setrecursionlimit(5000000)
mod = pow(10, 9) + 7
al = [chr(ord("a") + i) for i in range(26)]
direction = [[1, 0], [0, 1], [-1, 0], [0, -1]]
n, m = list(map(int, input().split()))
ps = [input().split() for i in range(m)]
dic = {}
anslst = [0] * n
for i in range(m):
    p, s = ps[i]
    if s == "AC":
        dic[p] = 1
    else:
        if p in dic:
            continue
        else:
            anslst[int(p) - 1] += 1
ans = 0
for i in list(dic.keys()):
    ans += anslst[int(i) - 1]
print((len(dic), ans))

-import sys +import bisect, copy, heapq, math, sys +from collections import * +from functools import lru_cache +from itertools import accumulate, combinations, permutations, product +def ruiseki(lst): +    return [0] + list(accumulate(lst)) + + +def celi(a, b): +    return -(-a // b) + + +sys.setrecursionlimit(5000000) +mod = pow(10, 9) + 7 +al = [chr(ord("a") + i) for i in range(26)] +direction = [[1, 0], [0, 1], [-1, 0], [0, -1]] -ps = [list(input().split()) for i in range(m)] -li = [[0, 0] for i in range(n + 1)] -wa = 0 +ps = [input().split() for i in range(m)] +dic = {} +anslst = [0] * n +for i in range(m): +    p, s = ps[i] +    if s == "AC": +        dic[p] = 1 +    else: +        if p in dic: +            continue +        else: +            anslst[int(p) - 1] += 1 -# print(ps) -for i in range(m): -    if li[int(ps[i][0])][0] == 0: -        if ps[i][1] == "AC": -            li[int(ps[i][0])][0] += 1 -        else: -            li[int(ps[i][0])][1] += 1 -    else: -        continue -for i in range(n + 1): -    if li[i][0] == 0: -        continue -    else: -        ans += 1 -        wa += li[i][1] -print(ans) -print(wa) +for i in list(dic.keys()): +    ans += anslst[int(i) - 1] +print((len(dic), ans))