main :: IO ()
main = do
  n <- toInt <$> getLine
  ss <- mapM (\_ -> toInt <$> getLine) [1..n]
  let sumNum = sum ss
  print $ if not (mod sumNum 10 == 0) 
            then sumNum 
            else if minNotTen ss == 0
                   then 0
                   else sumNum - minNotTen ss

minNotTen :: [Int] -> Int
minNotTen [] = 0
minNotTen (x:xs) = if mod x 10 == 0 then minNotTen xs else x

toInt :: String -> Int 
toInt = read