def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def r_sort(a) a.sort{|a,b|b<=>a} end

n = inp[0]
t = []
n.times do|i|
  d = inp
  next if(d[0] == 0 and d[1] == 0)
  ka = d[0]/d[1].to_f
  tails = Math.atan(ka)*180/Math::PI
  tails +=180 if(d[1]<0)
  t.push([tails.to_f,d[0],d[1]])
end
x = y = 0
ans = 0
tail =0

sum = 0
t.sort_by!{|u|u[0]}
tails = t[0][0]

t.each do |a|
  nt = a[0]
  x += a[1]
  y += a[2]
  while(tails < (nt-89.99999000) and tail < t.size)
    x -= t[tail][1]
    y -= t[tail][2]
    tail += 1
    tails = t[tail][0]
  end
  ans = [ans,(x**2+y**2)**0.5].max
end
p ans

=begin
def search(t,d, ind)
  ans = 0
  return
end
n = inp[0]
@memo = na2(n,n,false)
n.times do |i|
  @memo[i][0] = 0
end
@mem = na2(n+1,n+1)
a = []
n.times do |i|
  a[i] = inp
end
n.times do |i|
  (n-1).times do|j|
    p 7
    @mem[i+1][a[i][j]] = j
  end
end
@mem.each do|a|
  p a
end
=end