N=gets.to_i
ls=N.times.map{gets.split.map(&:to_i)}
ls.sort_by!{|x,y|Math.atan2(y,x)}
ans=0
(0...N).to_a.repeated_combination(2) do |i,j|
  x,y=0,0
  for k in i..j
    x+=ls[k][0]
    y+=ls[k][1]
  end
  cnt=(x**2.0+y**2.0)**(1/2.0)
  ans < cnt ? cnt : ans
end
puts ans