require "complex"

def angle coordinate # [x,y,arg]
  x = coordinate[0]
  y = coordinate[1]
  Complex(x, y).arg
end

def is_included_range? s_coordinate # 90度の範囲で探したいので、そこの処理をよしなにできるようにする
  s_angle = angle(s_coordinate)
  target_angle = angle(self)
  if 0 < s_angle && s_angle <= Math::PI/2 # 0~90度以下
    s_angle <= target_angle && target_angle <= s_angle + Math::PI/2
  elsif Math::PI/2 < s_angle && s_angle <= Math::PI # 90~180度以下
    s_angle <= target_angle || (-Math::PI + (s_angle - Math::PI/2)) >= s_angle
  elsif -Math::PI < s_angle && s_angle <= -Math::PI/2 # 180~270度以下
    s_angle <= target_angle && target_angle <= s_angle + Math::PI/2
  else # 270~360度
    s_angle <= target_angle && target_angle <= (Math::PI/2 + s_angle)
  end
end

def distance coordinate
  return 0 if coordinate == []
  (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

N=gets.chomp.to_i

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

ary.sort_by!(&:last)


distances = []

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

puts distances.max