program test03
 implicit none
 integer N, M
 integer i
 integer,allocatable :: AC(:)
 integer,allocatable :: WA(:)
 integer Nnum
 character Nkek*2
 integer :: allAC=0, allWA=0


 read *, N, M
 allocate(AC(N))
 allocate(WA(N))
 AC=0; WA=0

 do i=1,M
  read *, Nnum, Nkek
  if ( Nkek == 'AC' ) then
   AC(Nnum)=1
  else
   if ( AC(Nnum) == 0 ) then
   WA(Nnum)=WA(Nnum)+1
   end if
  end if
 end do

 do i=1,N
  allAC=allAC+AC(i)
  if ( AC(i) == 1 ) then
   allWA=allWA+WA(i)
  end if
 end do

 print '(i0,A,i0)', allAC, ' ',allWA

endprogram test03
