taro, hanako = 0, 0
(n = gets.to_i).times do

  t, h = gets.split
  if t == h
    taro += 1
    hanako += 1
  elsif t < h
    hanako += 3
  elsif t > h
    taro += 3
  else
  end
end

puts "#{taro} #{hanako}"