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