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 {
    var iList = List[Int]()
    try {
      for (i <- sList.sorted) {
        if (i % 10 == 0) iList :+= i
        sum -= i
        if (sum % 10 != 0) {
          if ((sum + iList.sum) % 10 != 0) sum = sum + iList.sum
          throw new RuntimeException("break")
        }
      }
    } catch {
      case _ => 0
    } finally {
      println(sum)
    }
  }
}