# C - Bugged

def main():

    n = int(eval(input()))

    s = [int(eval(input())) for _ in range(n)]

    s.sort()

  

    if sum(s) % 10 != 0:

        print((sum(s)))

    else:

        for i in range(n):

            if s[i] % 10 != 0:

                s.pop(i)

                print((sum(s)))

                exit()

        else:

            print((0))





if __name__ ==  "__main__":

    main()
# C - Bugged

def main():

    n = int(eval(input()))

    s = [int(eval(input())) for _ in range(n)]

    s.sort()

  

    if sum(s) % 10 != 0:

        print((sum(s)))

    else:

        for i in range(n):

            if s[i] % 10 != 0:

                print((sum(s)-s[i]))

                exit()

        else:

            print((0))





if __name__ ==  "__main__":

    main()
# C - Bugged
def main():
    n = int(eval(input()))
    s = [int(eval(input())) for _ in range(n)]
    s.sort()
    if sum(s) % 10 != 0:
        print((sum(s)))
    else:
        for i in range(n):
            if s[i] % 10 != 0:
                s.pop(i)
                print((sum(s)))
                exit()
        else:
            print((0))


if __name__ == "__main__":
    main()

# C - Bugged
def main():
    n = int(eval(input()))
    s = [int(eval(input())) for _ in range(n)]
    s.sort()
    if sum(s) % 10 != 0:
        print((sum(s)))
    else:
        for i in range(n):
            if s[i] % 10 != 0:
                print((sum(s) - s[i]))
                exit()
        else:
            print((0))


if __name__ == "__main__":
    main()

-                s.pop(i) -                print((sum(s))) +                print((sum(s) - s[i]))