use std::time::Instant;

type Float = f64;
type Int = i64;

fn read_stdin() -> String {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    s
}
 
fn read_line() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim_right().to_owned()
}
 
fn split_whitespace(line: &str) -> Vec<i32> {
    line.split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect()
}

struct Vector {
    x: Int,
    y: Int
}

fn as_vector(line: &str) -> Vector {
    let v = split_whitespace(line);
    Vector { x: v[0] as Int, y: v[1] as Int }
}

fn dot(a: &Vector, b: &Vector) -> Int {
    a.x * b.x + a.y * b.y
}

fn length2(a: &Vector) -> Int {
    a.x * a.x + a.y * a.y
}

fn distance(a: &Vector, b: &Vector) -> Int {
    2 as Int * dot(a, b) + length2(b)
}

fn add(a: &Vector, b: &Vector) -> Vector {
    Vector { x: a.x + b.x, y: a.y + b.y }
}

impl Vector {
    fn length(&self) -> Float {
        let v = self.x * self.x + self.y * self.y;
        (v as Float).sqrt()
    }
}

fn rand(n: u32, seed: u32) -> Vec<u32> {
    (0..(seed % 5)).map(|i| ((seed >> i) % n)).collect::<Vec<_>>()
}

fn next(vs: &Vec<Vector>, is: Vec<bool>, seed: u32) -> Vec<bool> {
    let mut is_tmp = is.clone();
    
    let max = length(vs, &is);
    
    for i in rand(vs.len() as u32, seed) { 
        is_tmp[i as usize] = !is_tmp[i as usize];
    }
    
    loop {
        let t = total(vs, &is_tmp);
        
        let mut is_break = false;
        for (index, v) in vs.iter().enumerate() {
            let rv = Vector { x: -v.x, y: -v.y };
            let d = distance(&t, if is_tmp[index] { &rv } else { v });
            if d > 0 as Int { is_tmp[index] = !is_tmp[index]; is_break = true; break; }
        }
        if !is_break { break; }
    }
    
    if length(vs, &is_tmp) > max { is_tmp } else { is }
}

fn total(vs: &Vec<Vector>, is: &Vec<bool>) -> Vector {
    vs.iter().zip(is.iter())
        .fold(Vector { x: 0, y: 0 }, |acc, (v, &i)| {
            if i { add(&acc, v) } else { acc }
        })
}

fn length(vs: &Vec<Vector>, is: &Vec<bool>) -> Float {
    total(vs, is).length()
}

fn initial(vs: &Vec<Vector>) -> Vec<Vec<bool>> {
    let mut is = Vec::new();
    is.push(vs.iter().map(|v| v.x > 0).collect());
    is.push(vs.iter().map(|v| v.x < 0).collect());
    is.push(vs.iter().map(|v| v.y > 0).collect());
    is.push(vs.iter().map(|v| v.y < 0).collect());
    is
}

fn force(vs: &Vec<Vector>) -> Float {
    let n = vs.len();
    
    let mut max = 0 as Float;
    for i in 0..(2_u32.pow(n as u32)) {
        let is = (0..n).map(|j| (i & (1 << j)) != 0).collect::<Vec<_>>();
        let value = length(&vs, &is);
        if max < value { max = value; }
    }
    max
}

fn main() {
    let now = Instant::now();
    read_line();
    let vs = read_stdin().lines()
        .map(as_vector)
        .collect::<Vec<_>>();
    
    if vs.len() < 24 {
        println!("{}", force(&vs));
        return;
    }
        
    let mut iss = initial(&vs);
    
    loop {
        let seed = now.elapsed().subsec_nanos();
        if now.elapsed().as_secs() == 1 && seed > 800_000_000 {
            break;
        }
        
        for is in iss.iter_mut() {
            *is = next(&vs, is.clone(), seed);
        }
    }
    
    let max = iss.iter().map(|is| length(&vs, is)).fold(0 as Float, |acc, value| value.max(acc));
    println!("{}", max);
}

Measured memory_bytes: 4352