program ccc
implicit none

integer :: n, m, p, i
character(2) :: s
integer,allocatable,dimension(:) :: q, r

read*, n, m
allocate(q(n),r(n))
q = 0
r = 0

do i = 1, m
read*, p, s
	if (s=='AC') then
    	if (q(p)==0) then
        q(p) = 1
        end if
    else
    	if (q(p)==0) then
	    r(p) = r(p) + 1
        end if
    end if
end do

print*, sum(q), sum(r)

end program