import Control.Monad
import Data.List

toInt :: String -> Int
toInt = read :: String -> Int

solve :: [Int] -> Int
solve s
  | mod t 10 == 0 = t-m
  | otherwise = t
    where
      t = sum s
      m = head $ filter (\x -> mod x 10 /= 0) $ sort s

check :: [Int] -> Bool
check s = (length $ filter (\x -> mod x 10 /= 0) s) > 0

main = do
  n <- toInt <$> getLine
  s <- map toInt <$> replicateM n getLine
  print $ if check s then (solve s) else 0
