fun main(args:Array<String>) {
    val n = readLine()!!.toInt()
    val scores = (1..n).map { readLine()!!.toInt() }
    var total = scores.sum()
    if(total % 10 == 0) {
        val tmp = scores.filter { it % 10 != 0 }.min()
        total -= tmp?:total
    }
    println(total)
}
