n = gets.chomp.to_i

taro = 0
hanako = 0

n.times do
  c_t, c_h = gets.chomp.split

  if c_t == c_h
    taro += 1
    hanako += 1
  else
    c_t > c_h ? taro += 3 : hanako += 3
  end
end

puts "#{taro} #{hanako}"

