tscore = hscore = 0
n = gets.to_i
n.times {
	tcard, hcard = gets.split( " " )
	if tcard < hcard
		hscore += 3
	elsif hcard < tcard
		tscore += 3
	else
		hscore += 1
		tscore += 1
	end
}
puts( "#{tscore} #{hscore}" )