=begin
=end

taro = hana = 0

n = gets.to_i

n.times do
  t, h = gets.chomp.split
  if t > h
    taro += 3
  elsif t < h
    hana += 3
  else
    taro += 1
    hana += 1
  end
end

puts "#{taro} #{hana}"
