require "complex"

class Array
  def is_included_range? s_coordinate # 90度の範囲で探したいので、そこの処理をよしなにできるようにする
    s_angle = angle(s_coordinate)
    target_angle = angle(self)
    if Math::PI/2 < s_angle && s_angle <= Math::PI # 90~180度以下(ラジアンがまたぐところだけベット処理)
      s_angle <= target_angle || (-Math::PI + (s_angle - Math::PI/2)) >= target_angle
    else #0~90度, 180~360度
      s_angle <= target_angle && target_angle <= Math::PI/2 + s_angle
    end
  end
end

def angle coordinate # [x,y,arg]
  x = coordinate[0]
  y = coordinate[1]
  Complex(x, y).arg
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{|attr| attr[1]}.compact&.inject(&:+)
  if x.nil? || y.nil?
    []
  else
    [x,y]
  end
end

ary=[]

N=gets.chomp.to_i
N.times do
  coordinate = gets.chomp.split.map(&:to_i)
  arg = angle coordinate
  ary << coordinate + [arg]
end

distances = []
ary.each do |attr|
  engines = ary.select{|a| a.is_included_range?(attr)}
  distances << distance(squish(engines))
end
  
puts distances.max