program main
	implicit none
	integer :: N,c_a,c_w,c_t,c_r,i
	character(3), allocatable :: S(:)
	read(*,*) N
	allocate(S(N))
	do i=1,N
		read(*,*) S(i)
	end do
	c_a=0;c_w=0;c_t=0;c_r=0
	do i=1,N
		if(S(i)=="AC") then
			c_a=c_a+1
		else if(S(i)=="WA") then
			c_w=c_w+1
		else if(S(i)=="TLE") then
			c_t=c_t+1
		else if(S(i)=="RE") then
			c_r=c_r+1
		end if
	end do
	write(*,*) "AC x",c_a
	write(*,*) "WA x",c_w
	write(*,*) "TLE x",c_t
	write(*,*) "RE x",c_r
end program main