n = gets.to_i

countA = 0
countB = 0

for i in 1..n
    input = gets.chomp.split(" ")

    if input[0] == input [1]
        countA += 1
        countB += 1
        next
    end

    tmp = [input[0], input[1]]
    tmp.sort!
    
    if input[0] == tmp[0]
        countB += 3
    else
        countA += 3
    end
end

puts "#{countA} #{countB}"
