tarou, hanako = 0, 0
gets.to_i.times {
    t,h = gets.chomp.split(" ")
    if t == h
        tarou += 1
        hanako += 1
    elsif t > h
        tarou += 3
    else
        hanako += 3
    end
}

puts "#{tarou} #{hanako}"