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

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

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


