import sys



n, *s = list(map(int, sys.stdin.read().split()))



def main():

    res = sum(s)

    if res % 10:

        return res

    else:

        not_multiple_of_10 = [x for x in s if x % 10]

        if not_multiple_of_10:

            return res - min(not_multiple_of_10)

        else:

            return 0



if __name__ == '__main__':

    ans = main()

    print(ans)
import sys



n, *a = list(map(int, sys.stdin.read().split()))



def main():

  s = sum(a)

  if s % 10: ans = s

  else: 

    m = min([101] + [x for x in a if x % 10])

    if m == 101: ans = 0

    else: ans = s - m

  print(ans)



if __name__ == '__main__':

  main()
import sys

n, *s = list(map(int, sys.stdin.read().split()))


def main():
    res = sum(s)
    if res % 10:
        return res
    else:
        not_multiple_of_10 = [x for x in s if x % 10]
        if not_multiple_of_10:
            return res - min(not_multiple_of_10)
        else:
            return 0


if __name__ == "__main__":
    ans = main()
    print(ans)

import sys

n, *a = list(map(int, sys.stdin.read().split()))


def main():
    s = sum(a)
    if s % 10:
        ans = s
    else:
        m = min([101] + [x for x in a if x % 10])
        if m == 101:
            ans = 0
        else:
            ans = s - m
    print(ans)


if __name__ == "__main__":
    main()

-n, *s = list(map(int, sys.stdin.read().split())) +n, *a = list(map(int, sys.stdin.read().split())) -    res = sum(s) -    if res % 10: -        return res +    s = sum(a) +    if s % 10: +        ans = s -        not_multiple_of_10 = [x for x in s if x % 10] -        if not_multiple_of_10: -            return res - min(not_multiple_of_10) +        m = min([101] + [x for x in a if x % 10]) +        if m == 101: +            ans = 0 -            return 0 +            ans = s - m +    print(ans) -    ans = main() -    print(ans) +    main()