crd_n = $stdin.gets(chomp:true).to_i
cards = []
score = [0,0]

crd_n.times do
  cards << $stdin.gets.split
end

cards.each do | card |
  case card[0] <=> card[1]
  when 0
    score[0] += 1
    score[1] += 1
  when -1
    score[1] += 3
  when 1
    score[0] += 3
  end
end

puts score.join(" ")
