N = gets.to_i

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

ans = 0

4.times do |i|
  list = []

  engines.each do |x, y|
    case i
    when 0
      next if x + y < 0
    when 1
      next if -x + y < 0
    when 2
      next if -x - y < 0
    when 3
      next if x - y < 0
    end

    list << [x, y]
  end

  sum_x = 0
  sum_y = 0

  ok = []
  cand = []

  list.each do |x, y|
    case i
    when 0
      if x >= 0 && y >= 0
        ok << [x, y]
      else
        cand << [x, y]
      end
    when 1
      if x <= 0 && y >= 0
        ok << [x, y]
      else
        cand << [x, y]
      end
    when 2
      if x <= 0 && y <= 0
        ok << [x, y]
      else
        cand << [x, y]
      end
    when 3
      if x >= 0 && y <= 0
        ok << [x, y]
      else
        cand << [x, y]
      end
    end
  end

  ok.each do |x, y|
    sum_x += x
    sum_y += y
  end

  cand.each do |x, y|
    nx = sum_x + x
    ny = sum_y + y

    if Math.sqrt(nx ** 2 + ny ** 2) > Math.sqrt(sum_x ** 2 + sum_y ** 2)
      sum_x = nx
      sum_y = ny
    end
  end

  dist = Math.sqrt(sum_x ** 2 + sum_y ** 2)

  ans = dist if ans < dist
end

puts ans
