n=gets.to_i
v = []
pm = []
p = []
m = []
pp = 0
mm = 0
n.times do |i|
  x, y = gets.split.map(&:to_f)
  if x>0
    v[i] = [y/x, x, y]
    p << v[i]
  elsif x<0
    v[i] = [y/x, x, y]
    m << v[i]
  elsif y>0
    pp += y
  elsif y<0
    mm += y
  end
end
p.sort!
m.sort!
cx = 0
cy = pp
p.each do |v0, vx, vy|
  cx += vx
  cy += vy
end
c = (cx**2+cy**2)**0.5
max = c

i = 0
j = 0
while j < m.length
  cx += m[j][1]
  cy += m[j][2]
  while i < p.length && p[i][0] <= m[j][0]
    cx -= p[i][1]
    cy -= p[i][2]
    i += 1
  end
  c = (cx**2+cy**2)**0.5
  if c > max
    max = c
  end
  j += 1
end
cy += mm
while i < p.length
  cx -= p[i][1]
  cy -= p[i][2]
  i += 1
end
cy -= pp
c = (cx**2+cy**2)**0.5
if c > max
  max = c
end


i = 0
j = 0
while i < p.length
  cx += p[i][1]
  cy += p[i][2]
  while j < m.length && m[j][0] <= p[i][0]
    cx -= m[j][1]
    cy -= m[j][2]
    j += 1
  end
  c = (cx**2+cy**2)**0.5
  if c > max
    max = c
  end
  i += 1
end
cy += pp
while j < m.length
  cx -= m[j][1]
  cy -= m[j][2]
  j += 1
end
cy -= mm
c = (cx**2+cy**2)**0.5
if c > max
  max = c
end
p max