taro = 0
hanako = 0
gets.to_i.times do
  t, h = case gets.split.inject{|a, b| a <=> b}
                 when -1
                   [0, 3]
                 when 0
                   [1, 1]
                 when 1
                   [3, 0]
                 end
  taro += t
  hanako += h
end
puts "#{taro} #{hanako}"