import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

main :: IO ()
main = do
    n <- fst . fromJust . B.readInt <$> B.getLine
    ss <- replicateM n $ fst . fromJust . B.readInt <$> B.getLine
    let t = sum ss
    if t `mod` 10 == 0
        then do
            let l = filter (\x -> x `mod` 10 /= 0) ss
            if null l
                then print (0 :: Int)
                else print $ t - minimum l
        else print t
