object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n = sc.nextInt()
  val s = List.fill(n)(sc.nextInt())
  val sum = s.sum
  if (sum % 10 != 0) {
    println(sum)
  } else {
    val t = s.filter(_ % 10 != 0)
    println(sum - t.minOption.getOrElse(sum))
  }
}
