N = gets.to_i
E = []
0.upto(N-1) do |i|
  E << gets.strip.split.map(&:to_i)
end

max = 0
0.upto(N-1) do |i|
  x = 0
  y = 0

  x = E[i][0]
  y = E[i][1]
  cur_dis = (x*x).abs + (y*y).abs

  if (i+1) < (N-1)
    (i+1).upto(N-1) do |j|
      next_dis = ((x+E[j][0])*(x+E[j][0])).abs + ((y+E[j][1])*(y+E[j][1])).abs
      if next_dis > cur_dis
        x += E[j][0]
        y += E[j][1]
        cur_dis = next_dis
      end
    end
  end

  if max < cur_dis
    max = cur_dis
  end
end

puts Math.sqrt(max)