n = gets.to_i
t_point = 0
h_point = 0

ARGF.each_line do |line|
  t_card, h_card = line.split

  case t_card <=> h_card
  when 1
    t_point += 3
  when 0
    t_point += 1
    h_point += 1
  when -1
    h_point += 3
  end
end

puts "#{t_point} #{h_point}"