n = gets.to_i

taro_score = 0
hanako_score = 0

n.times do
  taro, hanako = gets.split

  if taro > hanako
    taro_score += 3
  elsif taro < hanako
    hanako_score += 3
  else
    taro_score += 1
    hanako_score += 1
  end
end

puts "#{taro_score} #{hanako_score}"

