#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl '\n'
#define int long long
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define BIT(n) (1LL << (n))
#define TOUPPER(s) transform(s.begin(), s.end(), s.begin(), ::toupper)
#define TOLOWER(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define FILLZERO(s, n)                      \
    do {                                    \
        ostringstream os;                   \
        os << setw(n) << setfill('0') << s; \
        s = os.str();                       \
    } while (0);
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
#define INIT                               \
    std::cin.tie(nullptr);                 \
    std::ios_base::sync_with_stdio(false); \
    cout << std::fixed << std::setprecision(15);

using ll = long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using pi = pair<int, int>;
template <typename T>
using Pq = priority_queue<T>;
template <typename T>
using pQ = priority_queue<T, vector<T>, greater<T>>;

template <typename T>
vector<T> make_vec(size_t a, T n) { return vector<T>(a, n); }
template <typename T, typename... Ts>
auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); }
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

constexpr ll MOD = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;

class Args {
private:
    int upperSize = 0;

public:
    vector<pair<int, int>> pts;
    vector<pair<int, int>> rotPts;
    Args() = default;
    void add(int x, int y) { pts.push_back({x, y}); }
    void sort() {
        int n = pts.size();
        vector<pair<int, int>> upper, lower;
        for (int i = 0; i < n; i++) {
            if (pts[i].second == 0) {
                if (pts[i].first > 0) {
                    upper.push_back(pts[i]);
                } else {
                    lower.push_back(pts[i]);
                }
            } else if (pts[i].second > 0) {
                upper.push_back(pts[i]);
            } else {
                lower.push_back(pts[i]);
            }
        }
        upperSize = upper.size();

        auto comp = [&](pair<int, int> l, pair<int, int> r) -> bool {
            return (l.first * r.second - r.first * l.second > 0);
        };
        std::sort(upper.begin(), upper.end(), comp);
        std::sort(lower.begin(), lower.end(), comp);

        copy(upper.begin(), upper.end(), pts.begin());
        copy(lower.begin(), lower.end(), pts.begin() + upper.size());

        rotPts.resize(n);
        copy(lower.begin(), lower.end(), rotPts.begin());
        copy(upper.begin(), upper.end(), rotPts.begin() + lower.size());
    }

    //[0, 2N)の値を返す、インデックスを使うときは%Nすること
    int binary_search180(int index, bool isLowerBound = 1) {
        auto f = [&](vector<pair<int, int>> &v) {
            int ok = v.size();
            int ng = index;
            while (abs(ok - ng) > 1) {
                int mid = (ok + ng) / 2;
                int cross = v[index].first * v[mid].second - v[mid].first * v[index].second;
                int dot = v[mid].first * v[index].first + v[mid].second * v[index].second;
                if (cross == 0 && dot > 0) {
                    ng = mid;
                } else if (cross + !isLowerBound <= 0) {
                    ok = mid;
                } else {
                    ng = mid;
                }
            }
            return ok;
        };
        if (pts[index].second < 0 || (pts[index].second == 0 && pts[index].first < 0)) {
            index -= upperSize;
            return f(rotPts) + upperSize;
        } else {
            return f(pts);
        }
    }

    //[0, 2N)の値を返す、インデックスを使うときは%Nすること
    int binary_search90(int index, bool isLowerBound = 1) {
        auto f = [&](vector<pair<int, int>> &v, int bordor180) {
            int ok = bordor180;
            int ng = index;
            while (abs(ok - ng) > 1) {
                int mid = (ok + ng) / 2;
                int dot = v[mid].first * v[index].first + v[mid].second * v[index].second;
                if (dot + !isLowerBound <= 0) {
                    ok = mid;
                } else {
                    ng = mid;
                }
            }
            return ok;
        };
        if (pts[index].second < 0 || (pts[index].second == 0 && pts[index].first < 0)) {
            int bordor180 = binary_search180(index) - upperSize;
            index -= upperSize;
            return f(rotPts, bordor180) + upperSize;
        } else {
            return f(pts, binary_search180(index));
        }
    }
};

signed main() {
    INIT;
    cin >> N;
    vector<int> x(N), y(N);
    REP(i, N)
    cin >> x[i] >> y[i];
    Args args;
    REP(i, N) {
        if (x[i] == 0 && y[i] == 0)
            continue;
        args.add(x[i], y[i]);
    }
    N = args.pts.size();
    args.sort();
    double ans = 0;
    REP(i, N) {
        int j = args.binary_search180(i);
        auto a = args.pts[i];
        auto b = args.pts[(j - 1) % N];
        //dump(i, j, c, d);
        ll x = 0, y = 0;
        REP(j, N) {
            auto [vx, vy] = args.pts[(i + j) % N];
            x += vx;
            y += vy;
            chmax(ans, sqrt(x * x + y * y));
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 3812