import Data.List
import Control.Monad (replicateM)

getLines :: Int -> IO [String]
getLines n = replicateM n getLine
toPairs :: [String] -> (Double, Double)
toPairs (x:y:z) = (read x,read y)
toPairs _ = (0,0)

main = do
  n <- getLine
  ls <- getLines $ read n
  putStrLn $ show $ solv $  (toPairs $ words) <$>  ls

solv i = maximum $ map (\(x,y) -> sqrt (x*x + y*y))  $ scanl (\(x0,y0) (x1,y1) -> ((x0 + x1), (y0 + y1))) i