-- 1_4_D
main = do n <- getLine
          cs <- getLine
          putStr $ show $ minimum $ map (\x -> read x::Int) $ words cs
          putStr " "
          putStr $ show $ maximum $ map (\x -> read x::Int) $ words cs
          putStr " "
          putStrLn $ show $ sum $ map (\x -> read x::Int) $ words cs