n, m = map(int, input().split())
list_num = list([] for i in range(n))
test = [input().split() for i in range(m)]
check = [0] * n
for i in test:
  list_num[int(i[0]) - 1].append(i[1])
count = 0
count_ac = 0
count_wa = 0
check = 0
for i in list_num:
  for j in range(len(i)):
    if(i[j] =='WA'):
      count += 1
    else:
      count_ac += 1
      check = 1
      break
  if(check == 1):
    count_wa += count
    count = 0
    check = 0 

print(count_ac , count_wa)
