local min = 100
local sum = 0
local n = io.read("*n")
for i = 1, n do
  local a = io.read("*n")
  sum = sum + a
  if a % 10 ~= 0 then
    min = math.min(a, min)
  end
end
if sum % 10 ~= 0 then
  print(sum)
else
  if min == 100 then
    print(0)
  else
    print(sum - min)
  end
end
