program main
  implicit none
  integer(8) :: n, m, i, j, cor, pna
  integer(8), allocatable :: p(:), w(:)
  character(2), allocatable :: s(:)

  read(*,*) n, m
  allocate(p(m))
  allocate(w(n))
  allocate(s(m))
  do i = 1, m
     read(*,*) p(i), s(i)
  end do

  cor = 0
  pna = 0
  w(:) = 0
  do j = 1, m
     if(s(j) == 'WA') then
        if(w(p(j)) /= -1) then
           w(p(j)) = w(p(j)) + 1
        end if
        
     else
        if(w(p(j)) /= -1) then
           cor = cor + 1
           pna = pna + w(p(j))
           w(p(j)) = -1
        end if
     
     end if

  end do
  
     
     
  write(*,*) cor, pna
end program main

        
