fun main(args: Array<String>) {
    fun calcDist(x: Double, y: Double) = Math.sqrt((x * x + y * y))
    val n = readLine()!!.toInt()
    val xyrList = mutableListOf<Triple<Double, Double, Double>>()
    (1..n).forEach {
        val (x, y) = readLine()!!.split(' ').map(String::toDouble)
        xyrList.add(Triple(x, y, Math.atan2(y, x)))
    }
    xyrList.sortBy { it.third }
    xyrList.addAll(xyrList)
    var ans = 0.0
    for (start in 0 until n) {
        var end = start
        var curDist = calcDist(xyrList[start].first, xyrList[start].second)
        while (++end - start < n) {
            val subList = xyrList.subList(start, end + 1)
            val nextDist = calcDist(subList.map { it.first }.sum(), subList.map { it.second }.sum())
            if (curDist > nextDist) break else curDist = nextDist
        }
        ans = Math.max(ans, curDist)
    }
    println(ans)
}