n = STDIN.gets.to_i

p = [0, 0]
n.times {|i|
        input = STDIN.gets.split(' ')
        t = input[0]
        h = input[1]

        if t > h then
                p[0] += 3
        elsif t < h then
                p[1] += 3
        else
                p[0] += 1
                p[1] += 1
        end
}

puts p.join(' ')