n = gets.to_i

matches = n.times.map do
  a, b = gets.split
  case a <=> b
  when -1 then [0, 3]
  when  0 then [1, 1]
  when  1 then [3, 0]
  end
end

puts matches.transpose.map {|score| score.inject(:+) }.join(' ')