import java.util.Scanner

fun main(args: Array<String>) {
  val cin = Scanner(System.`in`)
  val n = cin.nextInt()
  var s = IntArray(n)
  var res = 0
  var minNum = 101

  for (i in 1..n) {
    val num = cin.nextInt()
    s[i - 1] = num
    res += num
    if (num < minNum && num % 10 != 0) {
      minNum = num
    }
  }

  if (res % 10 != 0) {
    println(res)
  } else if (minNum == 101) {
    println(0)
  } else {
    println(res - minNum)
  }

  cin.close()
}