import scala.io.StdIn.readLine

object Main extends App {
  val n = readLine.toInt
  val s = (for(i <- 0 until n) yield readLine.toInt).sorted
  val sum = s.sum
  val m = s.find(_ % 10 != 0)
  if(sum % 10 != 0) println(sum)
  else {
    m match {
      case Some(m) => println(sum - m)
      case _ => println(0)
    }
  }
}