n = gets.to_i
t = h = 0
n.times {
    cards = gets.chomp.split
    if cards[0] < cards[1]
        h += 3
    elsif cards[0] > cards[1]
        t += 3
    else
        t += 1
        h += 1
    end
}
puts "#{t} #{h}"
