import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

main :: IO ()
main = do
    n <- fst . fromJust . B.readInt <$> B.getLine
    ss <- replicateM n $ fst . fromJust . B.readInt <$> B.getLine
    let l = filter (\x -> x `mod` 10 /= 0) ss
    print $ if null l then 0 else sum ss - minimum l
