nn = gets.to_i
xy = nn.times.map{gets.split.map(&:to_i)}.sort_by{|a|Math.atan2(a[1],a[0])}.to_a

# 2周分定義
xy = xy*2
max=0
nn.times do |from|
  x = 0
  y = 0
  from.upto(from+nn-1) do |to|
    x += xy[to][0]
    y += xy[to][1]
    dist = Math.hypot(x,y)
    if max < dist
      max = dist
    end
  end
end

puts max
