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: import sys
  import math
  import collections
  import itertools
  import array
  import inspect
  
  # Set max recursion limit
  sys.setrecursionlimit(1000000)
  
  
  # Debug output
  def chkprint(*args):
      names = {id(v): k for k, v in inspect.currentframe().f_back.f_locals.items()}
      print(", ".join(names.get(id(arg), "???") + " = " + repr(arg) for arg in args))
  
  
  # Binary converter
  def to_bin(x):
      return bin(x)[2:]
  
  
  def li_input():
      return [int(_) for _ in input().split()]
  
  
  def gcd(n, m):
      if n % m == 0:
          return m
      else:
          return gcd(m, n % m)
  
  
  def gcd_list(L):
      v = L[0]
  
      for i in range(1, len(L)):
          v = gcd(v, L[i])
  
      return v
  
  
  def lcm(n, m):
      return (n * m) // gcd(n, m)
  
  
  def lcm_list(L):
      v = L[0]
  
      for i in range(1, len(L)):
          v = lcm(v, L[i])
  
      return v
  
  
  # Width First Search (+ Distance)
  def wfs_d(D, N, K):
      """
      D: 隣接行列(距離付き)
      N: ノード数
      K: 始点ノード
      """
  
      dfk = [-1] * (N + 1)
      dfk[K] = 0
  
      cps = [(K, 0)]
      r = [False] * (N + 1)
      r[K] = True
      while len(cps) != 0:
          n_cps = []
          for cp, cd in cps:
              for i, dfcp in enumerate(D[cp]):
                  if dfcp != -1 and not r[i]:
                      dfk[i] = cd + dfcp
                      n_cps.append((i, cd + dfcp))
                      r[i] = True
  
          cps = n_cps[:]
  
      return dfk
  
  
  # Depth First Search (+Distance)
  def dfs_d(v, pre, dist):
      """
      v:  現在のノード
      pre: １つ前のノード
      dist: 現在の距離
  
      以下は別途用意する
      D: 隣接リスト(行列ではない)
      D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
      """
  
      global D
      global D_dfs_d
  
      D_dfs_d[v] = dist
  
      for next_v, d in D[v]:
          if next_v != pre:
              dfs_d(next_v, v, dist + d)
  
      return
  
  
  def sigma(N):
      ans = 0
      for i in range(1, N + 1):
          ans += i
      return ans
  
  
  class Combination:
      def __init__(self, n, mod):
  
          g1 = [1, 1]
          g2 = [1, 1]
          inverse = [0, 1]
          for i in range(2, n + 1):
              g1.append((g1[-1] * i) % mod)
              inverse.append((-inverse[mod % i] * (mod // i)) % mod)
              g2.append((g2[-1] * inverse[-1]) % mod)
          self.MOD = mod
          self.N = n
          self.g1 = g1
          self.g2 = g2
          self.inverse = inverse
  
      def __call__(self, n, r):
          if r < 0 or r > n:
              return 0
          r = min(r, n - r)
          return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD
  
  
  # --------------------------------------------
  
  dp = None
  
  
  def main():
      N = int(input())
      S = [int(input()) for _ in range(N)]
  
      total = sum(S)
  
      if total % 10 != 0:
          print(total)
      else:
          min10x = 999
  
          for s in S:
              if s % 10 != 0 and s < min10x:
                  min10x = s
  
          if min10x == 999:
              print(0)
          else:
              print(total - min10x)
  
  
  main()
  
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."}]