import java.util.*

fun main(args: Array<String>) {
  val sc = Scanner(System.`in`)
  val n = sc.nextInt()
  val s = (1..n).map { sc.nextInt() }

  if (s.all { it % 10 == 0 }) {
    println(0)
    return
  }

  val min = s.filter { it % 10 != 0 }.min() ?: 0

  var ans = s.sum()
  if (ans % 10 == 0) {
    ans -= min
  }

  println(ans)
}
