
n = gets.to_i

t = 0
h = 0
n.times do |i|
    tt, hh = gets.split(" ")
    
    if tt > hh then
        t += 3
    elsif tt < hh then
        h += 3
    else
        t += 1
        h += 1
    end
end

print t," ", h, "\n"

