#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_genius = 0; ngtkana_is_genius < int(n); ngtkana_is_genius++)
#define rep(i, begin, end) for(int i = int(begin); i < int(end); i++)
#define lint long long
auto cmn = [](auto& a, auto b){if (a > b) {a = b; return true;} return false;};
auto cmx = [](auto& a, auto b){if (a < b) {a = b; return true;} return false;};
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail){
  std::cerr << " " << head;
  debug_impl(tail...);
}
#define debug(...) std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
  debug_impl(__VA_ARGS__);\
  std::cerr << std::noboolalpha;

template <typename T>
auto make_vector_impl(size_t sz, T t) {return std::vector<T>(sz, t);}

template <size_t N, typename T, typename U, std::enable_if_t<N == 1, std::nullptr_t> = nullptr>
auto make_vector(size_t sz, U u) {return make_vector_impl(sz, T(u));}

template <size_t N, typename T, std::enable_if_t<N == 1, std::nullptr_t> = nullptr>
auto make_vector(size_t sz) {return std::vector<T>(sz);}

template <size_t N, typename T, typename... Args, std::enable_if_t<N != 1, std::nullptr_t> = nullptr>
auto make_vector(size_t a, Args... args) {return make_vector_impl(a, make_vector<N - 1, T>(args...));}

template <typename T, typename Size_t>
auto& at(T& t, Size_t i) {return t.at(i);}

template <typename T, typename Size_t, typename... Args>
auto& at(T& t, Size_t i, Args... args) {return at(t.at(i), args...);}

template <typename T>
std::istream& operator>> (std::istream& is, std::vector<T>& v)
{
  for (auto & x : v) is >> x;
  return is;
}

template <typename T>
std::ostream& operator<< (std::ostream& os, const std::vector<T>& v)
{
  auto n = v.size();
  os << "{";
  for (size_t i = 0; i < n; i++)
    os << (i > 0 ? "," : "") << v[i];
  return os << "}";
}

template <typename T, typename U>
std::ostream& operator<< (std::ostream& os, const std::pair<T, U>& pair){
  return os << "(" << pair.first << "," << pair.second << ")";
}

template <typename T, typename U>
std::istream& operator>> (std::istream& is, std::pair<T, U>& pair) {
  return is >> pair.first >> pair.second;
}

template <typename... Args, std::size_t ... Inds>
std::ostream& tuple_output_impl
(
  std::ostream& os,
  const std::tuple<Args...>& tuple,
  std::integer_sequence<std::size_t, Inds...>
)
{
  os << "(";
  (void)std::initializer_list<int>{(
    (void)(os << (Inds > 0 ? "," : "") << std::get<Inds>(tuple)), 0
  )...};
  return os << ")";
}
template <typename... Args>
std::ostream& operator<< (std::ostream& os, const std::tuple<Args...>& tuple)
{
  return tuple_output_impl(os, tuple, std::index_sequence_for<Args...>());
}

template <typename... Args, std::size_t ... Inds>
std::istream& tuple_input_impl
(
  std::istream& is,
  std::tuple<Args...>& tuple,
  std::integer_sequence<std::size_t, Inds...>
)
{
  (void)std::initializer_list<int>{(
    (void)(is >> std::get<Inds>(tuple)), 0
  )...};
  return is;
}
template <typename... Args>
std::istream& operator>> (std::istream& is, std::tuple<Args...>& tuple)
{
  return tuple_input_impl(is, tuple, std::index_sequence_for<Args...>());
}

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int n; std::cin >> n;
  auto tuples = std::vector<std::tuple<double, int, int>>(n);
  for (auto& tuple : tuples) {
    int x, y; std::cin >> x >> y;
    double z = std::atan2(y, x);
    debug(x, y, z);
    tuple = std::make_tuple(z, x, y);
  }
  std::sort(tuples.begin(), tuples.end());
  tuples.insert(tuples.end(), tuples.begin(), tuples.end());
  auto pi = std::asin(1) * 2;
  std::for_each(tuples.begin() + n, tuples.end(), [pi](auto& t){
    std::get<0>(t) += pi * 2;
  });
  assert(std::is_sorted(tuples.begin(), tuples.end()));
  debug(tuples);
  lint X = 0, Y = 0;
  int l = 0, r = 0;
  double ret = 0;
  while (r < 2 * n) {
    auto head = tuples.at(l);
    auto next = tuples.at(r);
    if (std::get<0>(next) - std::get<0>(head) < pi) {
      r++;
      X += std::get<1>(next);
      Y += std::get<2>(next);
    } else if (r - l >= 1) {
      l++;
      X -= std::get<1>(head);
      Y -= std::get<2>(head);
    } else {
      l++, r++;
      X += std::get<1>(next);
      Y += std::get<2>(next);
      X -= std::get<1>(head);
      Y -= std::get<2>(head);
    }
    cmx(ret, std::sqrt((double)X * X + (double)Y * Y));
  }
  std::cout << std::fixed << std::setprecision(12) <<  ret << std::endl;
  return 0;
}

Measured memory_bytes: 384