#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef complex<ll> pt;

int main() {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<complex<ll>> V(N);
  for (pt& p : V) {
    int a, b;
    cin >> a >> b;
    p = {a, b};
  }
  sort(V.begin(), V.end(), [](pt a, pt b) {
    return atan2(a.real(), a.imag()) < atan2(b.real(), b.imag());
  });
  V.insert(V.end(), V.begin(), V.end());

  ll res = 0;
  for (int i = 0; i < N; i++) {
    pt p = {0, 0};
    for (int j = i; j < i + N; j++) {
      p += V[j];
      res = max(res, norm(p));
    }
  }
  cout << fixed << setprecision(15) << sqrt(res) << endl;

  return 0;
}
