object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = List.fill(sc.nextInt())(sc.nextInt()).sorted
  val max = s.sum match {
    case sum if sum % 10 != 0 => sum
    case sum => s.find(_ % 10 != 0).map(sum - _).getOrElse(0)
  }
  println(max)
}
