
import java.util.Scanner

object Main extends App {
  val sc = new Scanner(System.in)

  val n = sc.nextInt

  val seq = Range(0, n).map(_ => sc.nextInt).toSeq

  val sum = seq.sum
  val min = seq.filter(_ % 10 != 0).toStream.sorted.find(_ => true)

  if (sum % 10 != 0) {
    println(sum)
  } else {
    println(min match {
      case Some(n) => sum - n
      case None => 0
    })
  }
}
