program main
implicit none
integer i,m,n,p
integer,allocatable :: ac(:),wa(:)
character(2) s
read(*,*) n,m

allocate(ac(n))
allocate(wa(n))
ac(:)=0;wa(:)=0

do i=1,m
   read(*,*) p,s
   if(s=='AC' .and. ac(p)==0) then
      ac(p)=1
   else if(s=='WA' .and. ac(p)==0) then
      wa(p)=wa(p)+1
   end if
end do
      
write(*,'(i0,a,i0)') sum(ac),' ',sum(wa)
end program main

