"use strict"

function main(input) {

    input = input.split('\n').map(v => ~~v)
    const n = input[0]
    const s = input.slice(1, input.length).sort((a, b) => b - a)
    const sums = [0]
    for (let i = 0; i < n; i++) {

        sums.push(s[i] + sums[i])

    }
    // console.log(sums)
    for (let i = n; i > 0; i--) {
        if (sums[i] % 10 != 0) {
            console.log(sums[i])
            return
        }

    }
    //
    console.log(0)


}
main(require("fs").readFileSync("/dev/stdin", "utf8"));
