scoret, scoreh = 0, 0
gets.to_i.times do
  taro, hanako = gets.split(" ")
  if taro == hanako
    scoret += 1
    scoreh += 1
  else
    if taro > hanako
      scoret += 3
    else
      scoreh += 3
    end
  end
end
puts [scoret, scoreh].join(" ")