taro,hana = 0,0
count = gets.chomp.to_i
count.times do |i|
    wordarr = gets.chomp.split(" ").map do |s| s.to_s end
    if wordarr[0] > wordarr[1]
        taro += 3
    elsif wordarr[0] < wordarr[1]
        hana += 3
    else
        taro += 1
        hana += 1
    end
end
puts "#{taro} #{hana}"