

n = gets.chomp.to_i
lp, rp = 0, 0

n.times do |i|
  l, r = gets.chomp.split("\s")
  case l <=> r
  when -1 then
    rp += 3
  when 1 then
    lp += 3
  else
    lp += 1
    rp += 1
  end
end

puts "#{lp} #{rp}"