#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define debug(x) cout << #x << ": " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> void Print(vector<T> v) {
  F0R(i, v.size()) {
    cout << v[i] << ' ';
  }
  cout << newl;
}

#if 1

template<class T>
struct Vector2D {
  T X, Y;

  Vector2D(T x = 0, T y = 0) :X(x), Y(y) {}

  constexpr T MagnitudeSqr() const {
    return X * X + Y * Y;
  }

  constexpr T DistanceSqr(const Vector2D<T>& r) const {
    double a = r.X - X, b = r.Y - Y;
    return a * a + b * b;
  }

  constexpr double Distance(const Vector2D<T>& r) const {
    return sqrt(DistanceSqr(r));
  }

  Vector2D<T>& operator+=(const Vector2D<T>& r) {

    X += r.X;
    Y += r.Y;

    return *this;
  }

  friend Vector2D<T> operator+(Vector2D<T> l, const Vector2D<T>& r) {
    l += r;
    return l;
  }

  Vector2D<T>& operator-=(const Vector2D<T>& r) {

    X -= r.X;
    Y -= r.Y;

    return *this;
  }

  friend Vector2D<T> operator-(Vector2D<T> l, const Vector2D<T>& r) {
    l -= r;
    return l;
  }

  template<class N>
  Vector2D<T>& operator*=(const N& r) {

    X *= r;
    Y *= r;

    return *this;
  }

  template<class N>
  friend Vector2D<T> operator*(Vector2D<T> l, const N& r) {
    l *= r;
    return l;
  }

  template<class N>
  Vector2D<T>& operator/=(const N& r) {

    X /= r;
    Y /= r;

    return *this;
  }

  template<class N>
  friend Vector2D<T> operator/(Vector2D<T> l, const N& r) {
    l /= r;
    return l;
  }

  T DotProduct(const Vector2D<T>& r) const {
    return X * r.X + Y * r.Y;
  }

  Vector2D<T> Midpoint(const Vector2D<T>& r) const {
    return Vector2D<T>((X + r.X) / 2, (Y + r.Y) / 2);
  }

  // これが 0 のとき2つのベクトルは平行
  // （誤差を考え abs(perp) < eps という判定にした方が良い）
  T PerpProduct(const Vector2D<T>& r) const {
    return X * r.Y - Y * r.X;
  }

  static vector<Vector2D<T>> GetIntersectionOf2Lines(const Vector2D<T>& p1,
    const Vector2D<T>& v1, const Vector2D<T>& p2, const Vector2D<T>& v2,
    T eps = 1e-10) {

    T d = v1.PerpProduct(v2);

    if (Abs(d) < eps) {
      // 2つの線は平行

      // 重なっている場合は交点は存在することになるが、今回は省略
      return {};
    }

    auto w = p1 - p2;
    T si = v2.PerpProduct(w) / d;

    return { p1 + v1 * si };
  }

  friend constexpr ostream& operator << (ostream& os, const Vector2D<T>& x) noexcept {
    return os << x.X << ',' << x.Y;
  }
};

using ld = long double;

// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  cout << std::fixed << std::setprecision(15);

  int N;
  cin >> N;
  vector<Vector2D<ld>> vs(N);
  vector<ld> as(N);
  F0R(i, N) {
    cin >> vs[i].X >> vs[i].Y;
    as[i] = atan2(vs[i].Y, vs[i].X);
    //debug(as[i]);
  }

  ld result = 0;
  for (ld r = 0; r < M_PI * 2; r += 0.01) {
    Vector2D<ld> a(cos(r), sin(r)), b;

    F0R(i, N) {
      if (a.DotProduct(vs[i]) > 0) {
        b += vs[i];
      }
    }
    chmax(result, b.MagnitudeSqr());
  }

  cout << sqrt(result);
}
#endif


Measured memory_bytes: 3800