#include<bits/stdc++.h>
using namespace std;

void doRoutine() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    srand(322179);
#ifdef LOCAL
    freopen("/home/max/alg/clion_main/input.txt", "rt", stdin);
    freopen("/home/max/alg/clion_main/output.txt", "wt", stdout);
#endif
}

#define DBG(VAR) cerr << #VAR << ": " << VAR << endl

#define all(x) x.begin(), x.end()
#define vb vector<bool>
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define fi first
#define se second
#define pb push_back
#define vc vector
#define $ make_pair

#ifndef LOCAL
#define cerr if(0) cerr
#define DBG(...) (true)
#endif

#define D double
#define CD complex<D>
#define ll long long

#define pll pair<ll, ll>

// ----------------------------- CODE NOW ------------------------

const ll INF = 1000000000;

ll cr(pll v1, pll v2) {
    return v1.fi * v2.se - v2.fi * v1.se;
}

int side(pll vec) {
    if (vec.se > 0) {
        return 1;
    }
    else if (vec.se < 0) {
        return 2;
    }
    else {
        if (vec.fi > 0) {
            return 1;
        }
        else if (vec.fi < 0) {
            return 2;
        }
        else {
            return -1;
        }
    }
}

bool cmpangle(pll v1, pll v2) {
    if (side(v1) != side(v2)) {
        return side(v1) < side(v2);
    }
    else {
        return cr(v1, v2) > 0;
    }
}

pll inv(pll v) {
    return {-v.fi, -v.se};
}

pll compr(pll v) {
    ll g = abs(__gcd(v.fi, v.se));
    v.fi /= g;
    v.se /= g;
    return v;
}

ll hyp(pll vec) {
    return vec.fi * vec.fi + vec.se * vec.se;
}

signed main() {
    doRoutine();

    int n;
    cin >> n;
    vc<ll> x, y;
    for (int i = 0; i < n; ++i) {
        ll xt, yt;
        cin >> xt >> yt;
        if (xt != 0 || yt != 0) {
            x.pb(xt);
            y.pb(yt);
        }
    }
    n = x.size();

    map<pll, pll> arr;
    for (int i = 0; i < n; ++i) {
        pll vec(x[i], y[i]);
        arr[compr(vec)].fi += vec.fi;
        arr[compr(vec)].se += vec.se;
    }

    set<pll> dirs_st;
    for (auto el : arr) {
        dirs_st.insert(el.fi);
        dirs_st.insert(inv(el.fi));
    }

    vc<pll> dirs;
    for (auto el : dirs_st) {
        dirs.pb(el);
    }

    sort(all(dirs), cmpangle);

    map<pll, int> pos_in_dirs;
    for (int i = 0; i < dirs.size(); ++i) {
        pos_in_dirs[dirs[i]] = i;
    }

    vc<pll> vals(dirs.size());
    for (auto el : arr) {
        vals[pos_in_dirs[el.fi]] = el.se;
    }
    vc<pll> pref(vals.size() + 1);
    for (int i = 0; i < vals.size(); ++i) {
        pref[i + 1] = {pref[i].fi + vals[i].fi, pref[i].se + vals[i].se};
    }


    ll ans = 0;
    for (auto vec : dirs) {
        int from = pos_in_dirs[vec];
        int to = pos_in_dirs[inv(vec)];
        if (from < to) {
            pll cur = {pref[to].fi - pref[from].fi, pref[to].se - pref[from].se};
            ans = max(ans, hyp(cur));
        }
        else {
            pll cur = {pref.back().fi - pref[from].fi, pref.back().se - pref[from].se};
            cur = {cur.fi + pref[to].fi, cur.se + pref[to].se};
            ans = max(ans, hyp(cur));
        }
    }

    cout.precision(20);
    cout << sqrt((long double)ans) << endl;

    return 0;
}

Measured memory_bytes: 256