import Control.Monad

main = do
  n <- readLn
  a <- (map read) <$> replicateM n getLine
  putStrLn . show $ solve n a

solve:: Int -> [Int] -> Int
solve n a
  | mod ss 10 /= 0 = ss
  | length aa == 0 = 0
  | otherwise = ss - (minimum $ aa)
  where
    ss = sum a
    aa = filter (\x -> mod x 10 /= 0) a