fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val s = IntArray(N)
    (1..N).forEach {
        val a = readLine()!!.toInt()
        s[it - 1] = a
    }

    s.sort()

    val sum = s.sum()
    if (sum % 10 != 0) {
        println(sum)
    } else {
        val num = s.find {
            it % 10 != 0
        }
        if (num == null) {
            println(0)
        } else {
            println(sum - num)
        }
    }
}