//░░░░░░░░░░▄
//░░░░░░░░▄▐░▄▄█████▄▄
//░░░░░░▄█████████████▄▀▄▄░▄▄▄
//░░░░░█████████████████▄██████
//░░░░████▐█████▌████████▌█████▌
//░░░████▌█████▌█░████████▐▀██▀
//░▄█████░█████▌░█░▀██████▌█▄▄▀▄
//░▌███▌█░▐███▌▌░░▄▄░▌█▌███▐███░▀
//▐░▐██░░▄▄▐▀█░░░▐▄█▀▌█▐███▐█
//░░███░▌▄█▌░░▀░░▀██░░▀██████▌
//░░░▀█▌▀██▀░▄░░░░░░░░░███▐███
//░░░░██▌░░░░░░░░░░░░░▐███████▌
//░░░░███░░░░░▀█▀░░░░░▐██▐███▀▌
//░░░░▌█▌█▄░░░░░░░░░▄▄████▀░▀
//░░░░░░█▀██▄▄▄░▄▄▀▀▒█▀█░▀
//░░░░░░░░░▀░▀█▀▌▒▒▒░▐▄▄
//░░░░░░░░▄▄▀▀▄░░░░░░▄▀░▀▀▄▄
//░░░░░░▄▀░▄▀▄░▌░░░▄▀░░░░░░▄▀▀▄
//░░░░░▐▒▄▀▄▀░▌▀▄▄▀░░░░░░▄▀▒▒▒▐
//░░░░▐▒▒▌▀▄░░░░░▌░░░░▄▄▀▒▐▒▒▒▒▌
//░░░▐▒▒▐░▌░▀▄░░▄▀▀▄▀▀▒▌▒▐▒▒▒▒▐▐
//░░░▌▄▀░░░▄▀░█▀▒▒▒▒▀▄▒▌▐▒▒▒▒▒▌▌
//░░▄▀▒▐░▄▀░░░▌▒▐▒▐▒▒▒▌▀▒▒▒▒▒▐▒▌
//Anime in the beginning - I'm an absolute winner
#pragma GCC optimize("Ofast")
//#pragma comment(linker, "/stack:200000000")

#include <bits/stdc++.h>
//#include <cstdio>
//#include <cassert>
//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

#define ll long long
#define pii pair<int,int>
#define vpii vector<pii>
#define pb push_back
#define vi vector<int>
#define vll vector<ll>
#define vd vector<double>
#define vvd vector<vd>
#define pdd pair<double,double>
#define vpdd vector<pdd>
#define vvll vector<vll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define search(set0, x) (set0.find(x)!=set0.end())
#define vvi vector<vector<int>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define vvc vector<vc>
#define vvb vector<vb>
#define mp make_pair
#define F first
#define S second
#define pss pair<string, string>
#define vpss vector<pss>
#define ld long double
#define vvs vector<vs>
#define all(a) (a).begin(), (a).end()
#define mysort(a) sort(all(a))
#define myreverse(a) reverse(all(a))
#define printvi(arr) for (int x: arr) cout << x << ' '; cout << '\n';
#define printvll(arr) for (ll x: arr) cout << x << " "; cout << endl;
#define vvpii vector<vpii>
#define vvpll vector<vpll>
#define vp3i vector<pair<int, pii>>
#define treap Node*
#define printpair(p0) cout << p0.F << ' ' << p0.S << '\n';
#define printvp(arr) for (auto p0: arr) { printpair(p0) };
#define for1(i0, l0, r0) for (int i0 = l0; i0 < r0; ++i0)
#define for2(i0, l0, r0) for (int i0 = l0; i0 <= r0; ++i0)
#define ull unsigned long long
#define vpt vector<pt>
#define vvvi vector<vvi>
#define forn(i0, n0) for (int i0 = 0; i0 < n0; ++i0)
#define forn1(i0, n0) for (int i0 = 1; i0 < n0; ++i0)
#define vsi vector<set<int>>
#define relaxMax(a, b) a = max(a, b)
#define relaxMin(a, b) a = min(a, b)
//#define endl '\n'
//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int mod0 = 1e9 + 7;
const ll mod1 = 998244353;
const ll mod2 = 1e9 + 9;
const ll mod3 = 2147483647;

const int sz = 2 * 1024 * 1024;
const ll inf = 2 * 1024 * 1024 * 1023 - 1;
const ll INF = inf * inf;
const double eps = 1e-6;

void init() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout.precision(16);
}

struct pt {
    ld x, y;

    pt(ld x0, ld y0) {
        x = x0, y = y0;
    }
};

struct Vector {
    ll x, y;
    ll len;

    Vector(pt pt1, pt pt2) {
        x = pt2.x - pt1.x;
        y = pt2.y - pt1.y;
        len = x * x + y * y;
    }
};

pt pt0 = pt(0, 0);

ll product(Vector a, Vector b) {
    return a.x * b.y - a.y * b.x;
}

bool cmp(const pt &a, const pt &b) {
    Vector OA = Vector(pt0, a);
    Vector OB = Vector(pt0, b);
    ll pr = product(OA, OB);
    if (pr == 0) return (OA.len < OB.len);
    return (pr > 0);
}

bool rtt(pt a, pt b, pt c) {
    Vector AB = Vector(a, b);
    Vector BC = Vector(b, c);
    return (product(AB, BC) <= 0);
}

#define vpt vector<pt>

vpt convexHull(vpt a) {
    int n = a.size();
    int idx = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i].x < a[idx].x || (a[i].x == a[idx].x && a[i].y < a[idx].y)) idx = i;
    }
    vpt ans;
    pt0 = a[idx];
    sort(a.begin(), a.end(), cmp);
    for (int i = 0; i < n; ++i) {
        while (ans.size() >= 2 && rtt(ans[ans.size() - 2], ans.back(), a[i])) {
            ans.pop_back();
        }
        ans.pb(a[i]);
    }
    return ans;
}

void solve() {
    int n;
    cin >> n;
    vpii a(n);
    forn(i, n) cin >> a[i].F >> a[i].S;
    vpt xy;
    xy.pb(pt{0, 0});
    forn(i0, n){
        int k = xy.size();
        forn(i, k){
            xy.pb({xy[i].x + a[i0].F, xy[i].y + a[i0].S});
        }
        xy = convexHull(xy);
    }
    ld ans = 0;
    for (pt p: xy){
        relaxMax(ans, p.x * p.x + p.y * p.y);
    }
    cout << sqrt(ans) << '\n';
}

bool multitest = false;

int main() {
    init();
    int t = 1;
    if (multitest) cin >> t;
    forn(i, t) solve();
    return 0;
}

Measured memory_bytes: 256