require 'complex'

N = gets.to_i
arr = N.times.map { gets.split.map(&:to_i) }

max_length = 0

[[1, 1], [1, -1], [-1, 1], [-1, -1]].each do |x, y|
  now_point = [0, 0]
  arr.each do |next_x, next_y|
    if next_x * x >= 0 && next_y * y >= 0
      now_point[0] += next_x
      now_point[1] += next_y
    end
  end

  max_length = [max_length, Math.sqrt(now_point[0] ** 2 + now_point[1] ** 2)].max
end

puts max_length