#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define first_more_idx(ve, num) upper_bound(all(ve), num)-ve.begin() // idx = first_more_idx(ve,num); if(idx = ve.size()) , then not exist
#define first_lessequal_idx(ve, num) lower_bound(all(ve), num)-ve.begin()
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > // only sort first param
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}
ll power(ll x, ll n){if(n == 0) return 1;return  (n%2)? x*power(x, n-1)%MOD : power(x*x%MOD, n/2);}
ll dx[]={0, 0, -1, 1};
ll dy[]={1, -1, 0, 0};// up,down,left right


const double PI=3.141592653589;

ll N ;
vector<pair<ll,ll> >xy;


// inp1,inp2
ld calangle(pair<ll,ll> inp){
    ld angle = (ld)((inp.first)) /  sqrt((ld)(inp.first*inp.first + inp.second*inp.second));
    angle = acos(angle);
    if(inp.second < 0) angle = 2.0 * PI - angle;
    return angle;
}

bool func(pair<ll,ll> a, pair<ll,ll> b){
    return calangle(a) <= calangle(b);
}

ld cal(ll a, ll b){
    pair<ll,ll> ans1, ans2;
    ans1 = mp(0,0);
    ans2 = mp(0,0);
    
    
    rep(i, N){
        if(a <= i and  i <= b){
            ans1.first += xy[i].first;
            ans1.second += xy[i].second;
        }else{
            ans2.first += xy[i].first;
            ans2.second += xy[i].second;
        }
    }
    
    ld ans = max(
                 sqrt((ld)(ans1.first * ans1.first + ans1.second * ans1.second)),
                 sqrt((ld)(ans2.first * ans2.first + ans2.second * ans2.second))
                 );
    return ans;

}

void debug(ll a,ll b){
    cerr << "(" << a << "," << b << "):" << calangle(mp(a,b)) << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    debug(1,0);
    cerr << 0 << endl;
    debug(1,1);
    cerr << PI/4.0 << endl;
    debug(0,1);
    cerr << PI/2.0 << endl;
    debug(-1,1);
    cerr << PI/4.0 * 3.0 << endl;
    debug(-1,0);
    cerr << PI  << endl;
    debug(-1,-1);
    cerr << PI/4.0 * 5.0  << endl;
    debug(0,-1);
    cerr << PI / 2.0 * 3.0 << endl;
    debug(1,-1);
    cerr << PI / 4.0 * 7.0 << endl;
    
    
    cerr << "-----" << endl;
    debug(1,0);
    debug(1,1);
    debug(1,2);
    debug(1,3);
    debug(1,4);
    debug(0,1);
    debug(-1,4);
    debug(-1,3);
    debug(-1,2);
    debug(-1,1);
    debug(-1,0);
    debug(-1,-1);
    debug(-1,-2);
    debug(-1,-3);
    debug(-1,-4);
    debug(0,-1);
    debug(1,-1);
    debug(2,-1);
    debug(3,-1);
    debug(4,-1);
    
    
    cin >> N ;
    rep(i, N){
        ll x,y;
        cin >> x >> y;
        xy.pb(mp(x,y));
    }
    sort(all(xy), func);
    
//    cerr << "-------------------" << endl;
//    rep(i, xy.size()){
//        cerr << xy[i].first << " " << xy[i].second << "::" << calangle(xy[i])<< endl;
//    }
//    cerr << "-------------------" << endl;
    
    ld ans = 0.0L;
    for(int i = 0; i < N; i++){
        for(int j = i; j < N; j++){
            ans = max(ans, cal(i,j));
        }
    }

    cout << fixed << setprecision(48) << ans << endl;
    return 0;
}


Measured memory_bytes: 512