n = gets.to_i
point = Array.new(2, 0)

n.times do
  t, h = gets.split
  case
  when t > h
    point[0] += 3
  when t == h
    point[0] += 1
    point[1] += 1
  when t < h
    point[1] += 3
  end
end

puts point.join(" ")
