
object MainKt {
  @JvmStatic fun main(args:Array<String>) {
   val N=readLine()!!.toInt()

   val S=(1..N).map {readLine()!!.toInt()}
   val allc=S.fold(0){sum,ele -> sum+ele}

   println(if(allc%10==0) {allc-(S.filter{(allc-it) %10!=0}.min()?:allc)} else {allc})
  }
}
