#include <bits/stdc++.h>

#define f first
#define s second
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define ll long long
#define ull unsigned long long
#define db double
#define ld long double
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pli pair<ll, int>
#define px pair<db, db>
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define input(a) for (auto& el : a) cin >> el;
#define output(a) cout << '!'; for (auto& el : a) cout << el << ' '; cout << '\n'; cout.flush();
#define sz(el) int(el.size())
#define sq(a) ((a) * (a))
#define xll bitset<128>
#define xmin(a,b) a = min(a, b)
#define xmax(a,b) a = max(a, b)
#define sun(a) sort(all(a)); a.resize(unique(all(a)) - a.begin());
/**/  /// extra
//#define forn(i,n) for (int i = 0; i < n; ++i)
//#define rforn(i,n) for (int i = n - 1; i >= 0; --i)
#define bn '\n'
#define vi vector<int>
#define vii vector<vi>
#define vl vector<ll>
#define vll vector<vl>
//#define G vector<vector<pii>>
#define GVE vector<vector<edge>>
#define usi unordered_set<int>
#define usp set<pii>
/**/

using namespace std;

const int INF = 1'000'000'017;
const ll LLINF = 1'000'000'000'000'000'017LL;
const ld inf = 1.0 / 0.0;
const ld eps = 1e-9;
const int MOD = 998244353;

//mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

//uniform_int_distribution<int> uid(l, r); [l, r]
//int x = uid(rng);

struct Point {
    ll x = 0, y = 0;

    Point() {}

    Point(ll x, ll y) : x(x), y(y) {}

    ll operator*(const Point& p) const {
        return x * p.x + y * p.y;
    }

    ll operator%(const Point& p) const {
        return x * p.y - y * p.x;
    }

    ll len() {
        return x * x + y * y;
    }

    void operator+=(const Point& p) {
        x += p.x;
        y += p.y;
    }

    void operator-=(const Point& p) {
        x -= p.x;
        y -= p.y;
    }

    int part() const {
        return (y > 0 || (y == 0 && x > 0) ? 1 : 2);
    }
};

bool operator<(const Point& a, const Point& b) {
    int pa = a.part(), pb = b.part();
    if (pa != pb) {
        return pa < pb;
    }
    return a % b > 0;
}

int n;

int md(int x) {
    return (x >= n ? x - n : x);
}

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

    cin >> n;
    vector<Point> a;
    for (int i = 0; i < n; ++i) {
        Point p;
        cin >> p.x >> p.y;
        if (p.x != 0 || p.y != 0) {
            a.eb(p);
        }
    }
    n = sz(a);
    sort(all(a));
    Point opt, cur;
    int it = 0;
    for (int i = 0; i < 2 * n; ++i) {
        while (it <= i) {
            if (opt.len() < cur.len()) {
                opt = cur;
            }
            if (a[md(it)] % a[md(i)] < 0
                 || (a[md(it)] % a[md(i)] == 0 && a[md(it)] * a[md(i)] < 0)
                 || i - it == n) {
                cur -= a[md(it)];
                ++it;
            } else {
                break;
            }
        }
        if (opt.len() < cur.len()) {
            opt = cur;
        }
        cur += a[md(i)];
        if (opt.len() < cur.len()) {
            opt = cur;
        }
    }
    cout << setprecision(10) << fixed << sqrt(opt.len());
    return 0;
}


Measured memory_bytes: 256