N = int(eval(input()))

a = list(int(eval(input())) for _ in range(N))

a.sort()



ans = sum(a)

if ans%10 > 0:

    print(ans)

    exit()

for ai in a:

    if ai%10 > 0:

        print((ans - ai))

        break

else:

    print((0))

import sys



N = int(eval(input()))

S = [int(eval(input())) for _ in range(N)]

ans = sum(S)

if ans % 10 > 0:

    print(ans)

    sys.exit()



S.sort()

for si in S:

    if si % 10 > 0:

        print((ans - si))

        sys.exit()

print((0))

N = int(eval(input()))
a = list(int(eval(input())) for _ in range(N))
a.sort()
ans = sum(a)
if ans % 10 > 0:
    print(ans)
    exit()
for ai in a:
    if ai % 10 > 0:
        print((ans - ai))
        break
else:
    print((0))

import sys

N = int(eval(input()))
S = [int(eval(input())) for _ in range(N)]
ans = sum(S)
if ans % 10 > 0:
    print(ans)
    sys.exit()
S.sort()
for si in S:
    if si % 10 > 0:
        print((ans - si))
        sys.exit()
print((0))

+import sys + -a = list(int(eval(input())) for _ in range(N)) -a.sort() -ans = sum(a) +S = [int(eval(input())) for _ in range(N)] +ans = sum(S) -    exit() -for ai in a: -    if ai % 10 > 0: -        print((ans - ai)) -        break -else: -    print((0)) +    sys.exit() +S.sort() +for si in S: +    if si % 10 > 0: +        print((ans - si)) +        sys.exit() +print((0))