=begin
a = gets.split("").map{|x| x.to_s}
b = gets.split("").map{|x| x.to_s}
count = 0
3.times do |i|
  if a[i] == b[i]
    count += 1
  end
end

p count
=end

=begin
a = gets.split(" ").map{|x| x.to_i}
if a[1] == 1
  p 0
  exit()
end
a[1] -= a[0]
ans = 1
while true
  break if (a[1] <= 0)
  a[1] -= a[0] - 1
  ans += 1
end
p ans
=end

=begin
n = gets.to_i
a = gets.split(" ").map{|x| x.to_i}
max = 0

count = 0

(n - 1).times do |i|
  if a[i] >= a[i + 1]
    count += 1
  else
    if(max < count)
      max = count
    end
    count = 0
  end
end
if(max < count)
  max = count
end

p max
=end

=begin
input = gets.to_i
p (input - 1) * input / 2
=end
require 'bigdecimal'
pos = Array.new(4).map{Array.new(2, 0.0)}
n = gets.to_i
n.times do |i|
  engin = gets.split(" ").map{|x| x.to_f}
  if engin[0] == 0

    if engin[1] >= 0
      pos[0][1] += engin[1]
      pos[1][1] += engin[1]
    else
      pos[2][0] += engin[1]
      pos[3][0] += engin[1]
    end

  elsif engin[1] == 0

    if engin[0] >= 0
      pos[0][0] += engin[0]
      pos[3][0] += engin[0]
    else
      pos[1][0] += engin[0]
      pos[2][0] += engin[0]
    end

  else
    if engin[0] > 0 and engin[1] > 0
      pos[0][0] += engin[0]
      pos[0][1] += engin[1]
    elsif engin[0] < 0 and engin[1] > 0
      pos[1][0] += engin[0]
      pos[1][1] += engin[1]
    elsif engin[0] < 0and engin[1] < 0
      pos[2][0] += engin[0]
      pos[2][1] += engin[1]
    elsif engin[0] > 0 and engin[1] < 0
      pos[3][0] += engin[0]
      pos[3][1] += engin[1]
    end
  end
end

max = 0
4.times do |i|
  kyori = ( pos[i][0]**2 + pos[i][1]**2 )**(0.5)
  if max < kyori
    max = kyori
  end
end
p max
