fun main(args: Array<String>) = yorukatsu13b()

fun yorukatsu13b() {
    val n = readLine()!!.toInt()
    val sList = (1..n).map { readLine()!!.toInt() }

    val sum = sList.sum()
    val answer = if (sum % 10 != 0) sum else {
        sum - (sList.filterNot { it % 10 == 0 }.min() ?: return println(0))
    }

    println(answer)
}
