n = gets.to_i
taro = 0
hanako = 0
n.times do
  t, h = gets.split.map{|str|str[0,1]}
  # puts "#{t} #{h}"
  if t > h
    taro += 3
  elsif t < h
    hanako += 3
  else
    taro += 1
    hanako += 1
  end
end
puts "#{taro} #{hanako}"