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

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

  cor = 0
  pna = 0
  do i = 1, n
     w = 0
     do j = 1, m
        if(p(j) == i) then
           if(s(j) == 'WA') then
              w = w + 1
           else
              cor = cor + 1
              pna = pna + w
              exit
           end if
        end if
     end do
  end do

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

        
