import Control.Monad (replicateM)
import Data.List (sort)

main :: IO ()
main = do
    n <- readLn
    s <- replicateM n readLn
    print $ solve s

solve :: [Int] -> Int
solve x
    | s `mod` 10 /= 0 = s
    | otherwise = t2
    where
        s  = sum x
        t1 = dropWhile (\x -> x `mod` 10 == 0) . sort $ x
        t2 = if null t1 then 0 else s - head t1