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


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

toInt :: String -> Int 
toInt = read