import scala.collection.mutable._

object Main extends App{
    val sc = new java.util.Scanner(System.in)
    val N = sc.nextInt
    val in = Array.fill(N)(sc.nextInt)
    
    val pts = in.sorted
    val all_pt = pts.sum
    
    if (all_pt % 10 == 0) {
        val diffs = pts.filter(x => x % 10 != 0)
        if (diffs.isEmpty) {
            println(0)
        } else {
            println(all_pt - diffs.head)
        }
    } else {
        println(all_pt)  
    }
        
}   


