num = gets.to_i
count = 1
t_point = 0;h_point = 0
while count <= num
  count += 1
  t,h = gets.split(" ")
  if t > h
    t_point += 3
  elsif t < h
    h_point += 3
  else
    t_point += 1
    h_point += 1
  end
end
print "#{t_point} #{h_point}"