n = gets.to_i
e = []
n.times { e << gets.split.map(&:to_f) }

d = []
d << [0, 0] << [0, 0] << [0, 0] << [0, 0]

e.each { |x, y|
  d[0] = [d[0][0] + x, d[0][1] + y] if x >= 0 && y >= 0
  d[1] = [d[1][0] + x, d[1][1] + y] if x <= 0 && y >= 0
  d[2] = [d[2][0] + x, d[2][1] + y] if x >= 0 && y <= 0
  d[3] = [d[3][0] + x, d[3][1] + y] if x <= 0 && y <= 0
}

puts d.map { |x, y| Math.sqrt(x**2 + y**2) }.max
