n = gets.chomp.to_i

taro = 0
hanako = 0

3.times do |i|
   line = gets.chomp.split
   if line[0] == line[1]
      taro += 1
      hanako += 1
   elsif line[0] < line[1]
      hanako += 3
   elsif line[0] > line[1]
      taro += 3
   end
end

puts "#{taro} #{hanako}"