import Control.Applicative
import Data.List
import qualified Data.Set as Set

main = do
    n <- readLn
    list <- sequence (replicate n readLn)
    print $ solve n list

solve :: Int -> [Int] -> Int
solve n list = if mod s 10 /= 0 
                 then s
                 else (if x == [] then 0 else s - minimum x)
    where s = sum list
          x = filter (\y -> mod y 10 /= 0) list

