output_description: Print the maximum value that can be displayed as your grade.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      s_1
      s_2
      :
      s_N
attempt: # -*- coding: utf-8 -*-
  
  #############
  # Libraries #
  #############
  
  import sys
  
  input = sys.stdin.readline
  
  import math
  import bisect
  from collections import deque
  from fractions import gcd
  from functools import lru_cache
  
  
  #############
  # Constants #
  #############
  
  MOD = 10**9 + 7
  INF = float("inf")
  
  #############
  # Functions #
  #############
  
  
  ######INPUT######
  def inputI():
      return int(input().strip())
  
  
  def inputS():
      return input().strip()
  
  
  def inputIL():
      return list(map(int, input().split()))
  
  
  def inputSL():
      return list(map(str, input().split()))
  
  
  def inputILs(n):
      return list(int(input()) for _ in range(n))
  
  
  def inputSLs(n):
      return list(input().strip() for _ in range(n))
  
  
  def inputILL(n):
      return [list(map(int, input().split())) for _ in range(n)]
  
  
  def inputSLL(n):
      return [list(map(str, input().split())) for _ in range(n)]
  
  
  ######OUTPUT######
  def Yes():
      print("Yes")
  
  
  def No():
      print("No")
  
  
  #####Inverse#####
  def inv(n):
      return pow(n, MOD - 2, MOD)
  
  
  ######Combination######
  kaijo_memo = []
  
  
  def kaijo(n):
      if len(kaijo_memo) > n:
          return kaijo_memo[n]
      if len(kaijo_memo) == 0:
          kaijo_memo.append(1)
      while len(kaijo_memo) <= n:
          kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
      return kaijo_memo[n]
  
  
  gyaku_kaijo_memo = []
  
  
  def gyaku_kaijo(n):
      if len(gyaku_kaijo_memo) > n:
          return gyaku_kaijo_memo[n]
      if len(gyaku_kaijo_memo) == 0:
          gyaku_kaijo_memo.append(1)
      while len(gyaku_kaijo_memo) <= n:
          gyaku_kaijo_memo.append(
              gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo), MOD - 2, MOD) % MOD
          )
      return gyaku_kaijo_memo[n]
  
  
  def nCr(n, r):
      if n == r:
          return 1
      if n < r or r < 0:
          return 0
      ret = 1
      ret = ret * kaijo(n) % MOD
      ret = ret * gyaku_kaijo(r) % MOD
      ret = ret * gyaku_kaijo(n - r) % MOD
      return ret
  
  
  ######Factorization######
  def factorization(n):
      arr = []
      temp = n
      for i in range(2, int(-(-(n**0.5) // 1)) + 1):
          if temp % i == 0:
              cnt = 0
              while temp % i == 0:
                  cnt += 1
                  temp //= i
              arr.append([i, cnt])
      if temp != 1:
          arr.append([temp, 1])
  
      if arr == []:
          arr.append([n, 1])
      return arr
  
  
  #####LCM#####
  def lcm(a, b):
      return a * b // gcd(a, b)
  
  
  #####BitCount#####
  def count_bit(n):
      count = 0
      while n:
          n &= n - 1
          count += 1
      return count
  
  
  #############
  # Main Code #
  #############
  
  N = input()
  L = inputILs(N)
  
  L.sort()
  
  R = [l % 10 for l in L]
  
  x = 0
  for l in L:
      if l % 10 == 0:
          continue
      else:
          x = l
          break
  
  if x == 0:
      print(x)
  else:
      print(sum(L) - x)
  
problem_description: Statement
  
  You are taking a computer-based examination. The examination consists of N
  questions, and the score allocated to the i-th question is s_i. Your answer to
  each question will be judged as either "correct" or "incorrect", and your
  grade will be the sum of the points allocated to questions that are answered
  correctly. When you finish answering the questions, your answers will be
  immediately judged and your grade will be displayed... if everything goes
  well.
  
  However, the examination system is actually flawed, and if your grade is a
  multiple of 10, the system displays 0 as your grade. Otherwise, your grade is
  displayed correctly. In this situation, what is the maximum value that can be
  displayed as your grade?
samples: [{"input": "3\n    5\n    10\n    15", "output": "25\n    \n\nYour grade will be 25 if the 10-point and 15-point questions are answered\ncorrectly and the 5-point question is not, and this grade will be displayed\ncorrectly. Your grade will become 30 if the 5-point question is also answered\ncorrectly, but this grade will be incorrectly displayed as 0.\n\n* * *"}, {"input": "3\n    10\n    10\n    15", "output": "35\n    \n\nYour grade will be 35 if all the questions are answered correctly, and this\ngrade will be displayed correctly.\n\n* * *"}, {"input": "3\n    10\n    20\n    30", "output": "0\n    \n\nRegardless of whether each question is answered correctly or not, your grade\nwill be a multiple of 10 and displayed as 0."}]