import Control.Monad
import Data.List
main=do
 n<-readLn
 s<-replicateM n readLn
 print(f (sum s) [x|x<-s,(mod x 10)/=0])
  where f s d = if (mod s 10)==0 then (if d==[] then 0 else s-(head(sort d))) else s