import Control.Monad
import Data.List

main :: IO ()
main = do
  n <- readLn :: IO Int
  ss <- sort <$> replicateM n readLn :: IO [Int]
  let non10 = filter (\s -> s `mod` 10 /= 0) ss
  let sumAll = sum ss
  print $ if sumAll `mod` 10 /= 0
              then sumAll
              else if null non10
                    then
                      0
                    else
                      sum ss - head non10
