n = gets.to_i

taro_score, hanako_score = 0, 0
n.times do
	taro, hanako = gets.split(' ')

	if taro > hanako then
		taro_score += 3	
	elsif taro == hanako
		taro_score += 1
		hanako_score += 1
	else
		hanako_score += 3
	end
end

puts "#{taro_score} #{hanako_score}"