game_num = STDIN.gets.to_i
score_taro = 0
score_hanako = 0

1.upto(game_num) {
	cards = STDIN.gets.chomp.split(" ")
	if cards[0] > cards[1] then
		score_taro += 3
	elsif cards[0] < cards[1] then
		score_hanako += 3
	else
		score_taro += 1
		score_hanako += 1
	end
} 

print score_taro, " ", score_hanako, "\n"
