import Data.List (sort)

main = do
  _ <- read <$> getLine :: IO Int
  ss <- sort.map read.lines <$> getContents :: IO [Int]
  let sss = filter (\s->s`mod`10/=0) ss
      total = sum ss
  if total `mod` 10 /= 0
    then print total
    else if null sss
      then print 0
      else print $ total - head sss
