import Data.List
import Control.Monad

main =  readLn >>= flip replicateM readLn >>= print . solve . sort

solve :: [Int] -> Int
solve ss
    | s `mod` 10 == 0 = edit ss
    | otherwise = s
    where
        s = sum ss

        edit (x : xs)
            | x `mod` 10 == 0 = edit xs
            | otherwise = s - x
        edit _ = 0
