s = [0, 0]

gets.to_i.times do
  cards = gets.split
  if cards.uniq.size == 1
    s[0] += 1
    s[1] += 1
    next
  end
  judge = cards.sort
  s[judge[1] == cards[1] ? 1 : 0] += 3
end

puts "#{s[0]} #{s[1]}"