
n = gets.to_i
x = [0,0,0,0,0]
y = [0,0,0,0,0]
for i in 1..n
    dx,dy = gets.split(" ").map(&:to_f)
    #puts "    received #{dx}, #{dy}"
    if dx == 0 then
        x[1] += dx
        y[1] += dy
        x[3] += dx
        y[3] += dy
    elsif dx > 0
        x[1] += dx
        y[1] += dy
    else
        x[3] += dx
        y[3] += dy
    end
    if dy == 0 then
        x[2] += dx
        y[2] += dy
        x[4] += dx
        y[4] += dy
    elsif dy > 0
        x[2] += dx
        y[2] += dy
    else
        x[4] += dx
        y[4] += dy
    end

end
dist = 0.0
for i in 1..4
    disttmp = Math.sqrt(x[i]*x[i] + y[i]*y[i])
    if dist < disttmp then
        dist = disttmp
    end
end
puts "#{dist}"
    