import scala.io.StdIn.readLine

object Main extends App {
  val n = readLine.toInt
  val s = (for(i <- 0 until n) yield readLine.toInt).sorted
  var sum = s.sum
  var i = 0
  while(sum % 10 == 0 && sum != 0) {
    sum -= s(i)
    i += 1
  }
  println(sum)
}