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