import java.util.Arrays

object Main extends App {
  val n = io.StdIn.readInt
  val score = Iterator.continually(io.StdIn.readInt)
    .take(n)
    .toArray
  
  Arrays.sort(score)

  val ans = {
    val sum = score.sum
    if(sum % 10 != 0) sum
    else {
      val a = score.find(_ % 10 != 0)
      val min = a match {
        case Some(x) => x
        case None => 0
      }
      if(min == 0) 0 else sum - min
    }
  }

  println(ans)
}