fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val s = IntArray(n) { readLine()!!.toInt() }
    val sum = s.sum()
    if (sum % 10 != 0) {
        println(sum)
        return
    }
    val t = s.filter { it % 10 != 0 }.min()
    println(if (t == null) 0 else sum - t)
}
