program main
	implicit none
	integer N, i, ans, score
	integer, allocatable :: s(:)
	read(*, *) N
	allocate(s(1: N))
	do i = 1, N
		read(*, *) s(i)
	end do
	score = sum(s)
	if(mod(score,10) /= 0) then
		write(*, *) score
	else
		ans = score
		do i = 1, N
			if(mod(s(i),10) /= 0) then
				ans = min(s(i), ans)
			end if
		end do
		write(*, *) score - ans
	end if
end program main