import io.StdIn.readInt
object Main extends App {
  val n = readInt
  val ss = Seq.fill(n)(readInt)
  println(solve(ss))
  def solve(ss: Seq[Int]) = {
    val all = ss.sum
    val sub = ss.filter(_ % 10 != 0)
    if (all % 10 != 0) all
    else if (!sub.isEmpty) all - sub.min
    else 0
  }
}
