import Control.Monad
import Data.List

main=do
    n<-readLn
    ss<-replicateM n readLn
    let s = sum ss
    print $ if s`mod`10 /= 0
        then s
        else case find (\n -> n`mod`10 /= 0) $ sort ss of
            (Just x) -> s-x
            Nothing -> 0