#include <bits/stdc++.h>
 
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define INF  (1<<30)
#define INFL (1LL<<60)
#define EPS ((ld)(1e-9))
 
#define sz(x) ((int)(x).size())
#define setz(x) memset(x, 0, sizeof(x))
#define all(x) (x).begin(), (x).end()
#define rep(i, e) for (int i = 0, _##i = (e); i < _##i; i++)
#define repp(i, s, e) for (int i = (s), _##i = (e); i < _##i; i++)
#define repr(i, s, e) for (int i = (s)-1, _##i = (e); i >= _##i; i--)
#define repi(i, x) for (auto &i : (x))
#define ARR(...) vector<int>({__VA_ARGS__})
#define ARS(...) vector<string>({__VA_ARGS__})
 
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef complex<double> base;
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef pair<ll, ll> pll;
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) { 
    return os << '(' << pai.first << ' ' << pai.second << ')';
}
 
template<typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
    cout << '[';
    for (auto p : v) cout << p << ",";
    cout << "]";
    return os;
}
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const set<T, V> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}
 
template<typename T, typename V>
ostream &operator<<(ostream &os, const map<T, V> v) {
    cout << "{";
    for (auto p : v) cout << p << ",";
    cout << "}";
    return os;
}
 
#ifndef __SOULTCH
#define debug(...) 0
#define endl '\n'
#else
#define debug(...) cout << " [-] ", _dbg(#__VA_ARGS__, __VA_ARGS__)
template<class TH> void _dbg(const char *sdbg, TH h){ cout << sdbg << '=' << h << endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
    while(*sdbg != ',') cout << *sdbg++;
    cout << '=' << (h) << ','; 
    _dbg(sdbg+1, a...);
}
#endif
 
template<typename T> void get_max(T &a, T b) {a = max(a, b);}
template<typename T> void get_min(T &a, T b) {a = min(a, b);}

int ccw(pii a, pii b, pii c) {
    ll v1 = (ll)a.fi*b.se + (ll)b.fi*c.se + (ll)c.fi*a.se;
    ll v2 = (ll)a.se*b.fi + (ll)b.se*c.fi + (ll)c.se*a.fi;

    if (v1 > v2) return 1;
    if (v1 < v2) return -1;
    return 0;
}

pii operator-(pii a, pii b) {
    return mp(a.fi-b.fi, a.se-b.se);
}

ll norm(pii a) {
    return (ll)a.fi*a.fi + (ll)a.se*a.se;
}

vector<pii> convex(vector<pii> pt) {
    auto p = min_element(all(pt));
    if (p != pt.begin()) swap(*p, pt[0]);

    sort(pt.begin()+1, pt.end(), [&](pii a, pii b) {
        int v = ccw(pt[0], a, b);
        if (v == 0) return norm(a-pt[0]) < norm(b-pt[0]);
        return v == 1;
    });

    vector<pii> res;
    rep(i, sz(pt)) {
        while(sz(res) > 1 and ccw(res[sz(res)-2], res[sz(res)-1], pt[i]) != 1) res.pop_back();
        res.push_back(pt[i]);
    }

    return res;
}

int N;

int main(void) {
    iostream::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> N;
    vector<pii> cp = {mp(0, 0)};

    rep(z, N) {
        pii t; cin >> t.fi >> t.se;
        rep(i, sz(cp)) cp.push_back({cp[i].fi+t.fi, cp[i].se+t.se});
        cp = convex(cp);
    }

    ll res = 0;
    rep(i, sz(cp)) get_max(res, norm(cp[i]));

    cout << fixed << setprecision(30) << sqrt(res) << endl;
}






Measured memory_bytes: 256