main = do
 getLine
 ss <- map read . words <$> getContents
 print (bugged ss)

bugged ss
 | mod (sum ss) 10 == 0 = sum ss - sm
 | otherwise = sum ss
 where
  sm = minimum' (filter (\x -> mod x 10 /= 0) ss)
  minimum' xs = if null xs then sum ss else minimum xs