score = [0, 0]
n = gets.chomp.to_i
n.times{
    a, b =gets.chomp.split
    if a > b
        score[0] += 3
    elsif a < b
        score[1] += 3
    else
        score[0] += 1
        score[1] += 1
end
}
puts score.join(" ")