n = int(eval(input()))

nums = []

for _ in range(n):

    nums.append(int(eval(input())))

nums.sort()

ans = sum(nums)

if ans % 10 != 0:

    print(ans)

else:

    for num in nums:

        t = ans - num

        if t % 10 != 0:

            print(t)

            break

    else:

        print((0))
import sys



n = int(eval(input()))

nums = []

for _ in range(n):

    nums.append(int(eval(input())))

s = sum(nums)

if s % 10 != 0:

    print(s)

else:

    nums.sort()

    for num in nums:

        t = s - num

        if t % 10 != 0:

            print(t)

            break

    else:

        print((0))
n = int(eval(input()))
nums = []
for _ in range(n):
    nums.append(int(eval(input())))
nums.sort()
ans = sum(nums)
if ans % 10 != 0:
    print(ans)
else:
    for num in nums:
        t = ans - num
        if t % 10 != 0:
            print(t)
            break
    else:
        print((0))

import sys

n = int(eval(input()))
nums = []
for _ in range(n):
    nums.append(int(eval(input())))
s = sum(nums)
if s % 10 != 0:
    print(s)
else:
    nums.sort()
    for num in nums:
        t = s - num
        if t % 10 != 0:
            print(t)
            break
    else:
        print((0))

+import sys + -nums.sort() -ans = sum(nums) -if ans % 10 != 0: -    print(ans) +s = sum(nums) +if s % 10 != 0: +    print(s) +    nums.sort() -        t = ans - num +        t = s - num