iterater = gets.to_i
team = Array.new(2,0)
iterater.times { |n|  
	outcount = 0
	hitcount = 0
	while outcount < 3
		data = gets.chomp
		case data
		when "HIT"
			hitcount += 1
			if hitcount >= 4
				team[iterater%2] += 1
				hitcount = 3
			end
		when "HOMERUN"
			team[iterater%2] += hitcount+1
			hitcount = 0
		else
			outcount += 1
		end
	end
}
puts team[0]
puts team[1]