n=io.read("*n","*l")
s={}
max=0
for i=1,n do
    s[i]=io.read("*n")
    max=max+s[i]
end
table.sort(s)

for i=1,n do
    if max%10==0 and s[i]%10~=0 then
        max=max-s[i]
    elseif max%10~=0 then
        break
    end
end
print(max)