taro, hanako = 0, 0
gets.chomp.to_i.times do
  t,h = gets.chomp.split
  case t.casecmp(h)
  when 1
    taro += 3
  when 0
    taro += 1
    hanako += 1
  when -1
    hanako += 3
  end
end
puts "#{taro} #{hanako}"