n = gets.to_i
score = [0, 0]
n.times do
    cards = gets.split.map(&:to_s)
    if cards[0] > cards[1]
        score[0] += 3
    elsif cards[0] == cards[1]
        score[0] += 1
        score[1] += 1
    else
        score[1] +=3
    end
end
puts "#{score[0]} #{score[1]}"
