#include <bits/stdc++.h>

#if MYDEBUG
#include "lib/cp_debug.hpp"
#else
#define DBG(...) ;
#endif
#if __cplusplus <= 201402L
template <typename T>
T gcd(T a, T b) { return ((a % b == 0) ? b : gcd(b, a % b)); }
template <typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }
#endif
using LL = long long;
constexpr LL LINF = 334ll << 53;
constexpr int INF = 15 << 26;
constexpr LL MOD = 1E9 + 7;
namespace Convex {
using namespace std;
bool cw(int a, int b, int c, const std::vector<std::pair<std::pair<long long, long long>, int>>& y) {
  long long dx = y[b].first.first - y[a].first.first;
  long long dy = y[b].first.second - y[a].first.second;
  long long nx = y[c].first.first - y[b].first.first;
  long long ny = y[c].first.second - y[b].first.second;
  return dy * nx - dx * ny > 0;
}
bool ccw(int a, int b, int c, const std::vector<std::pair<std::pair<long long, long long>, int>>& y) {
  long long dx = y[b].first.first - y[a].first.first;
  long long dy = y[b].first.second - y[a].first.second;
  long long nx = y[c].first.first - y[b].first.first;
  long long ny = y[c].first.second - y[b].first.second;
  return dy * nx - dx * ny > 0;
}
std::vector<int> getIdx(const std::vector<std::pair<long long, long long>>& x) {
  int n = x.size();
  std::vector<std::pair<std::pair<long long, long long>, int>> X(n), Y, ch(2 * n);
  for (int i = 0; i < n; ++i) {
    X[i] = {x[i], -i};
  }
  Y = X;
  std::sort(X.begin(), X.end());
  int k = 0;
  for (int i = 0; i < n; ch[k++] = X[i++]) {
    while (k >= 2 and !ccw(-ch[k - 2].second, -ch[k - 1].second, -X[i].second, Y)) {
      --k;
    }
  }
  for (int i = n - 2, t = k + 1; i >= 0; ch[k++] = X[i--]) {
    while (k >= t and !ccw(-ch[k - 2].second, -ch[k - 1].second, -X[i].second, Y)) {
      --k;
    }
  }
  ch.resize(k - 1);
  std::vector<int> convexHullIdx;
  for (int i = 0; i < (int)ch.size(); ++i) {
    convexHullIdx.push_back(-ch[i].second);
  }
  return convexHullIdx;
}
}  // namespace Convex

namespace Problem {
using namespace std;

class Solver {
 public:
  int n;
  vector<LL> x, y;
  Solver(LL n) : n(n), x(n), y(n){};

  void solve() {
    for (int i = 0; i < n; ++i) {
      cin >> x[i] >> y[i];
    }
    vector<pair<LL, LL>> vs;
    vs.emplace_back(0, 0);
    for (int i = 0; i < n; ++i) {
      int s = vs.size();
      vector<pair<LL, LL>> vs2(vs);
      for (int j = 0; j < s; ++j) {
        vs2.emplace_back(vs[j].first + x[i], vs[j].second + y[i]);
      }
      auto tmp = Convex::getIdx(vs2);
      vs.clear();
      for (auto w : tmp) {
        vs.emplace_back(vs2[w]);
      }
      sort(vs.begin(), vs.end());
      vs.erase(unique(vs.begin(), vs.end()), vs.end());
    }
    int ansId = 0;
    LL squaresum = vs[0].first * vs[0].first + vs[0].second * vs[0].second;
    for (int i = 1; i < vs.size(); ++i) {
      LL tmp = vs[i].first * vs[i].first + vs[i].second * vs[i].second;
      if (tmp > squaresum) {
        ansId = i;
        squaresum = tmp;
      }
    }
    cout << sqrt(squaresum) << endl;
  }
};

}  // namespace Problem

int main() {
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(12);
  long long n = 0;
  std::cin >> n;

  Problem::Solver sol(n);
  sol.solve();
  return 0;
}


Measured memory_bytes: 256