program main
implicit none
integer i,j,k,m,n,n_answer,n_penalty
integer,allocatable :: p(:),S(:)
character(2) chr
read(*,*) n,m
allocate(p(m))
allocate(S(m))
S(:)=0
do i=1,m
   read(*,*) p(i),chr
   if (chr=='AC') then
      S(i)=1
   else if (chr=='WA') then
      S(i)=2
   end if
end do
n_answer=0; n_penalty=0
do i=1,n
   do j=1,m
   !write(*,*) 'i,j',i,j
   if(p(j)==i .and. S(j)==1) then
      n_answer = n_answer + 1
      do k=1,j-1
         if(p(k)==i) then
            if (S(k)==2) then
               n_penalty = n_penalty + 1
            end if
         end if
         !write(*,*) 'k,pen',k,n_penalty
       end do
       exit
    end if
    end do
end do
write(*,'(i0,a,i0)') n_answer,' ',n_penalty
end program main