program sample
    implicit none
    character(3)::s
    integer(8) :: i,j,m,n,w,t,a,r
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n
    w=0
    a=0
    r=0
    t=0
    do i=1,n
        read(*,*)s
        if (s .eq. 'WA')then
            w=w+1
        else if(s .eq. 'TLE')then
            t=t+1
        else if(s .eq. 'AC')then
            a=a+1
        else
            r=r+1    
        end if
    end do
    write(*,*)'AC * ',a
    write(*,*)'WA * ',w
    write(*,*)'TLE * ',t
    write(*,*)'RE * ',r
    stop
end program sample
  

