
object Main extends App {
  val N = readLine.toInt
  var sList = List[Int]()
  for (i <- 1 to N) {
    sList :+= readLine.toInt
  }
  var sum = sList.sum
  if (sum % 10 != 0) {
    println(sum)
  } else {
    val b = Breaks
    b.breakable {
      for (i <- sList.sorted) {
        sum -= i
        if (sum % 10 != 0) {
          println(sum)
          b.break
        }
      }
    }
    if (sum == 0) {
      println(0)
    }
  }
}