import java.util.Scanner

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

  val n = sc.nextInt

  val al = Seq.fill(n)(sc.nextInt)

  val sum = al.sum
  val alRes = al.filter(_ % 10 != 0)

  val res =
    if(sum % 10 != 0) sum
    else if(alRes.nonEmpty) sum -  alRes.min else 0

  println(res)
}
