n = gets.to_i
t_score,h_score = [0,0]

n.times {
  t,h = gets.chomp.split
  if t > h
    t_score += 3
  elsif t < h
    h_score += 3
  else
    t_score += 1
    h_score += 1
  end
  }
puts "#{t_score} #{h_score}"
