num = STDIN.gets.chomp().to_i
points = [0, 0]

for i in 0..num - 1 do
    line = STDIN.gets.chomp()
    cards = line.split(" ")
    result = cards[0] <=> cards[1]
    case result
    when -1 then
        points[1] += 3
    when 0 then
        points[0] += 1
        points[1] += 1
    when 1 then
        points[0] += 3
    end
end

puts points.join(" ")