module Main where

import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    n <- readLn
    ss <- sort <$> replicateM n readLn :: IO [Int]

    let a = sum ss
    let mb = find ((/= 0) . (`mod` 10)) ss
    if a `mod` 10 /= 0
        then print a
        else do
            case mb of
                Nothing -> print 0
                Just b  -> print (a - b)