ARY=[]
N=gets.chomp.to_i
N.times do
  ARY << gets.chomp.split.map(&:to_i)
end

class Array
  def is_included_range? coordinate # 90度の範囲で探したいので、そこの処理をよしなにできるようにする
    self.first * coordinate.first + self.last * coordinate.last >= 0
  end
end

def distance coordinate
  return 0 if coordinate.empty?
  (coordinate.first**2 + coordinate.last**2)**0.5
end

def squish ary
  x = ary&.map(&:first).compact&.inject(&:+)
  y = ary&.map(&:last).compact&.inject(&:+)
  if x.nil? || y.nil?
    []
  else
    [x,y]
  end
end

distances = []

ARY.each do |attr|
  engines = ARY.select{|a| a.is_included_range?(attr)}
  distances << distance(squish(engines))
end

puts distances.max