import Control.Applicative( (<$>))
import Control.Monad( replicateM)
import Data.List( sort)

main = do
    n_ <- readLn
    ss_ <- replicateM n_ readLn
    let
	perfect = sum ss_
	sortedSs = sort ss_

	exclude []	= 0
	exclude (s:ss)
	  | 0 /= s`rem`10   = perfect - s
	  | otherwise	    = exclude ss

    print $ if perfect `rem` 10 /= 0
		then perfect
		else exclude sortedSs