point1 = 0
point2 = 0

gets.to_i.times do
  str1, str2 = gets.chomp.split
  if str1 > str2
    point1 += 3
  elsif str2 > str1
    point2 += 3
  else 
    point1 += 1
    point2 += 1
  end
end

puts "#{point1} #{point2}"