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?

-----Constraints-----
 - All input values are integers.
 - 1 ≤ N ≤ 100
 - 1 ≤ s_i ≤ 100

-----Input-----
Input is given from Standard Input in the following format:
N
s_1
s_2
:
s_N

-----Output-----
Print the maximum value that can be displayed as your grade.

-----Sample Input-----
3
5
10
15

-----Sample Output-----
25

Your grade will be 25 if the 10-point and 15-point questions are answered correctly and the 5-point question is not, and this grade will be displayed correctly. Your grade will become 30 if the 5-point question is also answered correctly, but this grade will be incorrectly displayed as 0.
[{"code": "N = int(input())\ns = []\n\nfor i in range(N):\n  s.append(int(input()))\n  \nS = sum(s)\n\nif S%10 != 0:\n  print(S)\nelse:\n  b = True\n  for j in range(N):\n    if  s[j]%10 == 0:\n      continue\n    else:\n      b = False\n  if b:\n    print(0)\n  else:\n    s.sort()\n    for k in range(N):\n      if s[k]%10 != 0:\n        print(S-s[k])\n        break", "passed": true, "time": 0.22, "memory": 14308.0, "status": "done"}, {"code": "n=int(input())\ntens=[]\nothers=[]\nfor i in range(n):\n    s=int(input())\n    if s%10==0:\n        tens.append(s)\n    else:\n        others.append(s)\ntens.sort(reverse=True)\nothers.sort(reverse=True)\n\nscore=sum(tens)+sum(others)\nif score%10==0:\n    if len(others)!=0:\n        print(score-min(others))\n    else:\n        print(0)\nelse:\n    print(score)", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns_l = [ int(input()) for _ in range(n) ]\ns_l = sorted(s_l)\n\nif sum(s_l)%10 != 0:\n    ans = sum(s_l)\nelse:\n    ans = 0\n    base_ans = sum(s_l)\n    for i in range(n):\n        if (base_ans-s_l[i])%10 != 0:\n            ans  = max(base_ans-s_l[i], ans)\nprint(ans)", "passed": true, "time": 0.16, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\ns = [int(input()) for i in range(n)]\nst = sorted(s)\nans = [0]\n\nsm1 = sum(s)\nfor i in range(len(st)):\n    if sm1 % 10 != 0:\n        ans.append(sm1)\n        break\n    else:\n        sm1 -= st[i]\nsm2 = sum(s)\nfor i in range(len(st)):\n    if st[i] % 10 != 0:\n        ans.append(sm2 - st[i])\n        break\nprint(max(ans))", "passed": true, "time": 0.15, "memory": 14360.0, "status": "done"}, {"code": "n = int(input())\na = [int(input()) for _ in range(n)]\ns = sum(a)\nif s % 10 != 0:\n    print(s)\nelse:\n    for i in range(n):\n        if min(a) % 10 != 0:\n            print(s - min(a))\n            break\n        a.remove(min(a))\n    else:\n        print(0)", "passed": true, "time": 0.24, "memory": 14304.0, "status": "done"}, {"code": "n = int(input())\ns = sorted([int(input()) for _ in range(n)])\n\ngrade = 0 if sum(s) % 10 == 0 else (sum(s))\n\nif grade == 0:\n    for i in s:\n        if i % 10 != 0:\n            print((sum(s) - i))\n            return\n\nprint(grade)\n", "passed": true, "time": 0.35, "memory": 14196.0, "status": "done"}, {"code": "import sys, math\nfrom itertools import combinations as c, product as p\nfrom collections import deque\nsys.setrecursionlimit(10**9)\nINF = float('inf')\nMOD = 10**9 + 7\n#MOD = 998244353\n\n\ndef si(): return input()\ndef ii(): return int(input())\ndef fi(): return float(input())\ndef lstr(): return input().split()\ndef lint(): return list(map(int, input().split()))\ndef lintdec(): return list(map(lambda x:int(x) - 1, input().split()))\ndef lnstr(n): return [input() for _ in range(n)]\ndef lnint(n): return [int(input()) for _ in range(n)]\ndef lint_list(n): return [lint() for _ in range(n)]\n\n\n\n############################################################\nN = ii()\n\nans = 0\nS = []\nfor i in range(N):\n    s = ii()\n    ans += s\n    S.append(s)\n\nS.sort()\nif ans % 10 == 0:\n    for s in S:\n        if s % 10:\n            ans -= s\n            break\n    else:\n        ans = 0\n\nprint(ans)", "passed": true, "time": 0.14, "memory": 14348.0, "status": "done"}, {"code": "N=int(input())\nS=sorted([int(input()) for _ in range(N)])\n\nt=sum(S)\n\nif (t%10!=0):\n    print(sum(S))\nelse:\n    for i in S:\n        if (t-i)%10!=0:\n            print(t-i)\n            break\n    else:\n        print(0)", "passed": true, "time": 0.23, "memory": 14240.0, "status": "done"}, {"code": "n=sorted([int(input()) for _ in range(int(input()))]);r,a=sum(n),0\nif r%10==0:\n  for i in n:\n    if (r-i)%10!=0: a=max(a,r-i)\n  print(a)\nelse:\n  print(r)", "passed": true, "time": 1.57, "memory": 14120.0, "status": "done"}, {"code": "#16 C - Bugged\nN = int(input())\ns = [int(input()) for _ in range(N)]\ns = sorted(s,reverse = False)\n\nscore = sum(s)\nif score%10 == 0:\n    for i in s:\n        score -= i\n        if score%10 != 0:\n            break\n        score += i\n    else:\n        score = 0\nprint(score)", "passed": true, "time": 1.57, "memory": 14248.0, "status": "done"}, {"code": "import copy\nn=int(input())\ns=[int(input())  for i in  range(n)]\n\nSum=[]\nif sum(s)%10 != 0:\n  print(sum(s))\n  return\nfor i in s:\n  c=copy.copy(s)\n  c.remove(i)\n  baisu=sum(c)\n  #print(c)\n  if baisu % 10 != 0:\n    Sum.append(baisu)\n\nif len(Sum) == 0:\n  print(0)\nelse:\n  print(max(Sum))", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "N=int(input())\ns=[int(input()) for _ in range(N)]\n\ns = sorted(s)\nSUM = sum(s)\n\nif SUM % 10 != 0:\n  print(SUM)\n  return\n\nfor i in range(N):\n  if s[i] % 10 != 0:\n    print(SUM - s[i])\n    return\n    \nprint(0)", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "#!/usr/bin/env python3\nN = int(input())\ns = sorted([int(input()) for i in range(N)])\n\nans = sum(s)\n\nif ans % 10 == 0:\n    for i in s:\n        if i % 10 == 0:\n            pass\n        else:\n            ans -= i\n            if ans % 10 != 0:\n                break\n\nif ans % 10 == 0 and ans == sum(s):\n    print((0))\nelse:\n    print(ans)\n", "passed": true, "time": 0.15, "memory": 14368.0, "status": "done"}, {"code": "n=int(input())\nl=[int(input()) for i in range(n)]\n\nlis=[i for i in l if i%10!=0]\n\nsum_l=sum(l)\n\nif sum_l%10!=0:\n  print(sum_l)\nelse:\n  if len(lis)==0:\n    print(0)\n  else:\n    print(sum_l-min(lis))", "passed": true, "time": 0.14, "memory": 14060.0, "status": "done"}, {"code": "s = [int(input()) for _ in range(int(input()))]\n\nif sum(s) % 10 != 0:\n    print(sum(s))\nelse:\n    s.sort()\n    for x in s:\n        if x % 10 != 0:\n            print(sum(s) - x)\n            break\n    else:\n        print(0)", "passed": true, "time": 0.21, "memory": 14064.0, "status": "done"}, {"code": "N=int(input())\ns=[0]*N\ns_nz=[101]*N\nres=0\nfor i in range(N) :\n  s[i]=int(input())\n  if s[i]%10!=0 :\n    s_nz[i]=s[i]\n  res+=s[i]\nif res%10==0 :\n  if min(s_nz)==101 :\n    res=0\n  else :\n    res-=min(s_nz)\nprint(res)\n\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}, {"code": "from itertools import combinations\nn = int(input())\ns = sorted([int(input()) for _ in range(n)])\n\nans = sum(s)\nif ans % 10 != 0: print(ans)\nelif all(i%10 == 0 for i in s): print(0)\nelse:\n  for i in range(1,n):\n    for j in combinations(s,i):\n      t = sum(j)\n      if (ans-t)%10 != 0:\n        print(ans-t)\n        return", "passed": true, "time": 0.18, "memory": 14088.0, "status": "done"}, {"code": "import sys\n\nsys.setrecursionlimit(10 ** 8)\nini = lambda: int(sys.stdin.readline())\ninl = lambda: [int(x) for x in sys.stdin.readline().split()]\nins = lambda: sys.stdin.readline().rstrip()\ndebug = lambda *a, **kw: print(\"\\033[33m\", *a, \"\\033[0m\", **dict(file=sys.stderr, **kw))\n\n\ndef solve():\n    n = ini()\n    s = [ini() for _ in range(n)]\n    a = sum(s)\n    if a % 10 != 0:\n        return a\n    m = 1000\n    for x in s:\n        if x % 10 != 0 and m > x:\n            m = x\n    if m == 1000:\n        return 0\n    return a - m\n\n\nprint(solve())\n", "passed": true, "time": 0.15, "memory": 14284.0, "status": "done"}, {"code": "N = int(input())\ns = [int(input()) for _ in range(N)]\n\ns.sort()\nmod = [i%10 for i in s]\nans = sum(s)\n\nif ans%10 == 0:\n    if mod.count(0)==N:\n        ans=0\n    else:\n        for i in range(N):\n            if mod[i]!=0:\n                ans -=s[i]\n                break\n            \nprint(ans)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\ns = []\nfor i in range(n):\n    s.append(int(input()))\n\nif sum(s) % 10 != 0:\n    print((sum(s)))\nelse:\n    s.sort()\n    for i in range(n):\n        if s[i] % 10 == 0:\n            pass\n        else:\n            print((sum(s) - s[i]))\n            break\n    else:\n        print((0))\n", "passed": true, "time": 0.18, "memory": 14008.0, "status": "done"}, {"code": "n=int(input())\nl=[int(input())for _ in range(n)]\nl.sort()\nans=sum(l)\nif ans%10!=0:\n    print(ans)\n    return\nfor s in l:\n    if (ans-s)%10!=0:\n        print((ans-s))\n        return\nprint((0))\n", "passed": true, "time": 0.19, "memory": 14024.0, "status": "done"}, {"code": "n = int(input())\nproblems = [int(input()) for _ in range(n)]\nsum_all = sum(problems)\nnot_multi_of_10 = [x for x in problems if x % 10 != 0]\nnot_multi_of_10.sort()\n\nif sum_all % 10:\n    print(sum_all)\nelse:\n    if len(not_multi_of_10) == 0:\n        print(0)\n    else:\n        print(sum_all - not_multi_of_10[0])", "passed": true, "time": 0.14, "memory": 14048.0, "status": "done"}, {"code": "n = int(input())\ns = [int(input()) for _ in range(n)]\n\nans = sum(s)\nif ans % 10 != 0:\n    print(ans)\nelse:\n    if all([i % 10 == 0 for i in s]):\n        print(0)\n    else:\n        print(ans - min([i for i in s if i % 10 != 0]))", "passed": true, "time": 0.14, "memory": 14244.0, "status": "done"}, {"code": "N = int(input())\nscore = [int(input()) for _ in range(N)]\ns_score = sorted(score)\na = 0\nfor i in s_score:\n    if i % 10 != 0:\n        a = i\n        break\nif sum(score) % 10 != 0:\n    print(sum(score))\nelse:\n    if a == 0:\n        print(0)\n    else:\n        print(sum(score)-a)", "passed": true, "time": 0.14, "memory": 14176.0, "status": "done"}, {"code": "n = int(input())\nll = []\nfor i in range(n):\n    ll.append(int(input()))\nll.sort()\nans = sum(ll)\nif ans%10 == 0:\n    for l in ll:\n        if l%10 != 0:\n            print(ans-l)\n            return\n    print(0)\nelse:\n    print(ans)", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "N = int(input())\nminimum = 100 \ntotal = 0\nfor i in range(N):\n    s = int(input())\n    total += s \n    if s % 10 != 0:\n        minimum = min(minimum,s)\nif total % 10 != 0:\n    print(total)\nelif minimum == 100:\n    print(0)\nelse:\n    print(total - minimum)", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "N = int(input())\nS = [int(input()) for _ in range(N)]\n\nS.sort()\n\ns = sum(S)\n\nif s % 10 == 0:\n    for ss in S:\n        if (s - ss) % 10 != 0:\n            print(s - ss)\n            return\n\n    print(0)\n\nelse:\n    print(s)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "N = int(input())\ns = [int(input()) for _ in range(N)]\n\nres = 0\nother = []\n\nfor num in s:\n  if num % 10 == 0:\n    res += num\n  else:\n    other.append(num)\n    \nif other:\n  other.sort()\n  res += sum(other)\n  if res % 10 == 0:\n    res -= other[0]\n  print(res)\n  \nelse:\n  print(0)", "passed": true, "time": 0.22, "memory": 14316.0, "status": "done"}, {"code": "arr = []\narr2 = []\nfor i in range(int(input())):\n    a = int(input())\n    if a%10 == 0:\n        arr2.append(a)\n    else:\n        arr.append(a)\n\narr.sort()\nj = sum(arr)+sum(arr2)\nif j%10 != 0:\n    print(j)\nelse:\n    k = 0\n    while j%10 == 0 and k<len(arr):\n        j -= arr[k]\n        k += 1\n    if j%10 == 0:\n        print(0)\n    else:\n        print(j)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "n = int(input())\ns = sorted([int(input()) for _ in range(n)])\nans = sum(s)\nfor v in s:\n  if ans%10!=0:\n    print(ans)\n    break\n  if v%10!=0:\n    ans -= v\nelse:\n  print(0)", "passed": true, "time": 0.14, "memory": 14228.0, "status": "done"}, {"code": "n = int(input())\n#a, b = map(int,input().split())\n#l = list(map(int,input().split()))\n#l = [list(map(int,input().split())) for i in range(n)]\nsl = []\nfor i in range(n):\n    sl.append(int(input()))\n\ntotal = sum(sl)\nsl.sort()\n\nif total % 10 == 0:\n    ans = 0\n    for i in range(n):\n        if sl[i]%10!=0:\n            ans=total-sl[i]\n            break\nelse:\n    ans = total\nprint(ans)\n", "passed": true, "time": 0.19, "memory": 14356.0, "status": "done"}, {"code": "N=int(input())\ns=[]\nnin=10**7\nfor i in range(N):\n    temp=int(input())\n    if temp%10!=0:\n        nin=min(nin,temp)\n    s.append(temp)\n\nans=sum(s)\nif ans%10==0:\n    ans-=nin\n    print((max(ans,0)))\nelse:\n    print(ans)\n", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "N = int(input())\nS = []\nfor _ in range(N):\n    S.append(int(input()))\n\ns = sum(S)\nif s % 10 != 0:\n    print(s)\nelse:\n    S.sort()\n    for i in S:\n        if i % 10 != 0:\n            s -= i\n            break\n    if s % 10 == 0:\n        print(0)\n    else:\n        print(s)", "passed": true, "time": 0.15, "memory": 14224.0, "status": "done"}, {"code": "N=int(input())\ns=[int(input()) for i in range(N)]\ns.sort()\nans = sum(s)\nif ans%10!=0:\n    print(ans)\n    return\nelse:\n    for i in s:\n        ans2 = ans-i\n        if ans2%10!=0:\n            print(ans2)\n            return\nprint(0)", "passed": true, "time": 0.24, "memory": 14340.0, "status": "done"}, {"code": "n = int(input())\ns = [0]\nmins = 1000\nfor i in range(n):\n    tmp = int(input())\n    s.append(tmp)\n    if tmp%10!=0:\n        mins = min(mins,tmp)\nif sum(s)%10==0:\n    if mins == 1000:\n        print((0))\n    else:\n        print((sum(s)-mins))\nelse:\n    print((sum(s)))\n", "passed": true, "time": 0.24, "memory": 14256.0, "status": "done"}, {"code": "N = int(input())\ns = [int(input()) for _ in range(N)]\ns.sort()\nsu = sum(s)\n\nif su%10 != 0:\n    print(su)\n    return\n    \nfor i in s:\n    if i%10 != 0:\n        print(su - i)\n        return\nprint(0)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "n = int(input())\ns_lst = [int(input()) for _ in range(n)]\n\nmaximum = sum(s_lst)\ns_lst.sort()\n\n\nif maximum % 10 != 0:\n    answer = maximum\nelse:\n\n    for i in range(n):\n        maximum -= s_lst[i]\n        if maximum % 10 != 0:\n            answer = maximum\n            break\n        else:\n            maximum += s_lst[i]\n\n        if i == n - 1 and maximum == sum(s_lst):\n            answer = 0\n\nprint(answer)", "passed": true, "time": 0.14, "memory": 14056.0, "status": "done"}, {"code": "N = int(input())\nS = [int(input()) for _ in range(N)]\nif sum(S)%10 != 0:\n  print(sum(S))\nelse:\n  A = sorted(S)\n  for i in A:\n    if (sum(S)-i)%10 != 0:\n      print(sum(S)-i)\n      return\n  print(0)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "s = [int(input()) for _ in range(int(input()))]\n\nif sum(s) % 10 != 0:\n    print(sum(s))\nelse:\n    s.sort()\n    for i, x in enumerate(s):\n        if x % 10 != 0:\n            print(sum(s) - x)\n            break\n    else:\n        print(0)", "passed": true, "time": 0.18, "memory": 14188.0, "status": "done"}, {"code": "N = int(input())\nS = []\n\nfor i in range(N):\n  S.append(int(input()))\n  \nS.sort()\nans = sum(S)\n\nif ans % 10 != 0:\n  print(ans)\n  return\n  \nfor i in range(N):\n  if S[i] % 10 != 0:\n    ans -= S[i]\n    print(ans)\n    return\n\nprint((0))\n", "passed": true, "time": 0.15, "memory": 14028.0, "status": "done"}, {"code": "n = int(input())\nS = sorted([int(input()) for _ in range(n)])\n\nif sum(S)%10!=0:\n    print((sum(S)))\n    return\nfor i in range(n):\n    if S[i]%10==0:\n        continue\n    print((sum(S)-S[i]))\n    return\nprint((0))\n\n\n", "passed": true, "time": 0.14, "memory": 14280.0, "status": "done"}, {"code": "n = int(input())\na = [int(input()) for i in range(n)]\na.sort()\n\nans = sum(a)\nif ans % 10 != 0:\n    print(ans)\n    return\n    \nflg = False\nfor i in range(n):\n    if a[i] % 10 != 0:\n        ans -= a[i]\n        flg = True\n        break\nprint(ans) if flg else print(0)", "passed": true, "time": 0.14, "memory": 14172.0, "status": "done"}, {"code": "import sys\nN=int(input())\ns=[int(input()) for i in range(N)]\nnum=sum(s)\n\nif num%10!=0:\n    print(num)\nelse:\n    for i in range(N):\n        s=sorted(s)\n        if s[i]%10==0:\n            continue\n        else:\n            print(num-s[i])\n            return\n    print(0)", "passed": true, "time": 0.17, "memory": 14208.0, "status": "done"}, {"code": "n = int(input())\ns = [0] * n\nfor i in range(n):\n    s[i] = int(input())\n    \n\njudge = 0\nanswer = 0\n\nfor i in s:\n    answer += i\n    if i%10 == 0:\n        judge += 1 \n\n#print(answer)\n\ns.sort()\nmi = 0\n#print(s)\n\nfor i in s:\n    if i%10 != 0:\n        mi = i\n        break\n\n\n#print(mi)\n\nif judge == len(s):\n    print((0))\nelse:\n    if answer%10 == 0:\n        answer -= mi\n\n    print(answer)\n\n\n", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "N = int(input())\ns = []\nfor i in range(N):\n    s.append(int(input()))\n\ns.sort()\nx = sum(s)\n\nif str(x)[-1] != '0':\n    print(x)\n    return\n\nans = x\nfor i in range(N):\n    ans = max(x-s[i], ans-s[i])\n    if str(ans)[-1] != '0':\n        print(ans)\n        return\nprint((0))\n", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "n = int(input())\nsum=0\npoint=[]\nfor i in range(n):\n    now= int(input())\n    point.append(now)\n    sum+=now\n#point = list(map(int, input()))\nif sum%10!=0:\n    print(sum)\nelse:\n    point.sort()\n    judge = False\n    for i in point:\n        if i%10!=0:\n            point.remove(i)\n            sum-=i\n            judge = True\n            break\n    if judge:\n        print(sum)\n    else:\n        print((0))\n", "passed": true, "time": 0.14, "memory": 14188.0, "status": "done"}, {"code": "n = int(input())\nss = sorted([int(input()) for i in range(n)])\ntss = sum(ss) # total ss\nif tss % 10 != 0:\n  print(tss)\nelse:\n  for s in ss:\n    x = tss - s\n    if  x % 10 != 0:\n      print(x)\n      return\n  print(0)", "passed": true, "time": 0.14, "memory": 14288.0, "status": "done"}, {"code": "a=int(input())\nb=[int(input()) for i in range(a)]\nb.sort()\nc=sum(b)\nd=0\nif c%10!=0:\n  print(c)\nelse:\n  for i in range(a):\n    if b[i]%10!=0:\n      c=c-b[i]\n      print(c)\n      break\n  if sum(b)==c:\n    print(0)", "passed": true, "time": 0.14, "memory": 14032.0, "status": "done"}, {"code": "n=int(input())\ns=[int(input()) for i in range(n)]\ns.sort()\nS=sum(s)\nans=0\nif S%10!=0:\n  print(S)\nelse:\n  for i in range(n):\n    if (S-s[i])%10!=0:\n      ans=max(S-s[i],ans)\n  print(ans)", "passed": true, "time": 0.14, "memory": 14204.0, "status": "done"}, {"code": "N=int(input())\ns=[int(input()) for _ in range(N)]\nmn=101\nfor n in range(N):\n    if s[n]%10!=0:\n        mn=min(mn,s[n])\nif mn==101:\n    print((0))\nelse:\n    ss=sum(s)\n    print((ss if ss%10!=0 else ss-mn))\n\n", "passed": true, "time": 0.14, "memory": 14108.0, "status": "done"}, {"code": "# C - Bugged\ndef main():\n    n = int(input())\n    s = [int(input()) for _ in range(n)]\n    s.sort()\n  \n    if sum(s) % 10 != 0:\n        print(sum(s))\n    else:\n        for i in range(n):\n            if s[i] % 10 != 0:\n                s.pop(i)\n                print(sum(s))\n                return\n        else:\n            print(0)\n\n\nif __name__ ==  \"__main__\":\n    main()", "passed": true, "time": 0.14, "memory": 14152.0, "status": "done"}, {"code": "n=int(input())\ns=[int(input()) for i in range(n)]\nif sum(s)%10!=0:\n  print(sum(s))\nelse:\n  s.sort()\n  flag=0\n  for i in range(n):\n    if s[i]%10!=0:\n      print(sum(s)-s[i])\n      flag=1\n      break\n  if flag==0:\n    print(0)", "passed": true, "time": 0.14, "memory": 14184.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\n\ndef main():\n    ans = 0\n    n = int(input())\n    s = []   \n    for i in range(n):\n        t = int(input())\n        ans += t\n        s.append(t)\n    s.sort()\n    \n    if ans%10 == 0:\n        for i in range(n):\n            if s[i]%10 != 0:\n                ans -= s[i]\n                break\n    if ans%10 == 0:\n      ans = 0\n    print(ans)\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.24, "memory": 14128.0, "status": "done"}, {"code": "N = int(input())\ns = []\nfor i in range(N):\n  s.append(int(input()))\n\ns.sort()\nans = sum(s)\nif ans % 10 == 0:\n  fil = list(filter(lambda x: x % 10 != 0, s))\n  if len(fil) == 0:\n    print(0)\n  else:\n    print(ans - fil[0])\nelse:\n  print(ans)", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "n=int(input())\ns = [int(input()) for _ in range(n)]\ns.sort()\nif sum(s) %10 !=0:\n    print(sum(s))\n    return\nelse:\n    for i in range(n):\n        if s[i] %10 != 0:\n            print(sum(s) - s[i])\n            return\n        else:\n            continue\nprint(0)", "passed": true, "time": 0.15, "memory": 14160.0, "status": "done"}, {"code": "n = int(input())\ns = []\nfor _ in range(n):\n    s.append(int(input()))\nans = sum(s) if sum(s) % 10 != 0 else 0\ncheck = 0\nfor i in range(len(s)):\n    check = sum(s[:i]) + sum(s[i+1:])\n    ans = max(ans,(check if check % 10 != 0 else 0))\nprint(ans)", "passed": true, "time": 0.16, "memory": 14244.0, "status": "done"}, {"code": "n = int(input())\ns = [int(input()) for i in range(n)]\ns.sort()\nans = sum(s)\n\nif ans%10==0:\n    for i in range(len(s)):\n        if s[i]%10!=0 :\n            ans -= s[i]\n            break\n    else:\n        ans = 0\n\nprint(ans)\n", "passed": true, "time": 0.28, "memory": 14188.0, "status": "done"}, {"code": "n = int(input())\ns = []\nfor i in range(n):\n    s.append(int(input()))\nx = 0\nt = []\nfor i in range(n):\n    if s[i]%10 == 0:\n        t.append(i)\n        x += s[i]\ncnt = 0\nfor i in t:\n    del s[i-cnt]\n    cnt += 1\ns.sort()\nwhile sum(s)%10 == 0 and len(s)>0:\n    del s[0]\nif sum(s) == 0:\n    print(0)\nelse:\n    print(sum(s)+x)", "passed": true, "time": 0.15, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\np = []\n\nfor i in range(n):\n    p.append(int(input()))\n\np.sort()\n\nans = sum(p)\nif ans%10==0:\n    for i in p:\n        if i%10!=0:\n            ans -= i\n            break\n    if ans%10==0:\n        print((0))\n    else:\n        print(ans)\nelse:\n    print(ans)\n", "passed": true, "time": 0.14, "memory": 14164.0, "status": "done"}, {"code": "n = int(input())\ns=[]\n\nfor i in range(n):\n  sl = int(input())\n  s.append(sl)\n  \ns.sort()\nans = sum(s)\n\ni = 0\nwhile ans>0 and i<n:\n  if ans%10!=0:\n    print(ans)\n    return\n  else:\n    if s[i]%10!=0:\n      ans = ans-s[i]\n    i += 1\n      \nprint((ans%10))\n", "passed": true, "time": 0.15, "memory": 14080.0, "status": "done"}, {"code": "n = int(input())\na = [int(input()) for i in range(n)]\n\np, q = 0, 0\njudge = 1000\nfor v in a:\n  if v%10:\n    p += v\n    judge = min(judge, v)\n  else:\n    q += v\n\nans = p + q\nif ans % 10 == 0:\n  if judge == 1000:\n    ans = 0\n  else:\n    ans -= judge\n\nprint(ans)\n      \n\n", "passed": true, "time": 0.18, "memory": 14204.0, "status": "done"}, {"code": "N=int(input())\nS=[int(input()) for _ in range(N)]\nS.sort()\n\nx=sum(S)\nif x%10!=0:\n    print(x)\nelse:\n    for i in range(N):\n        if(x-S[i])%10!=0:\n            print((x-S[i]))\n            break;\n    else:\n        print((0))\n", "passed": true, "time": 0.19, "memory": 14100.0, "status": "done"}, {"code": "g = int(input())\n\ngrades = []\nfor i in range(g):\n    grade = int(input())\n    grades.append(grade)\n\ntotal = sum(grades)\ngrades.sort()\ngrades = [0] + grades\ncount = 0\nfor grade in grades:\n    if (total - grade) % 10 != 0:\n        print((total - grade))\n        break\n    else:\n        count += 1\n\nif count == len(grades):\n    print((0))\n", "passed": true, "time": 0.15, "memory": 14096.0, "status": "done"}, {"code": "Row = int(input())\nList = []\nfor i in range (Row):\n  List.append(int(input()))\nList.sort(reverse = True)\nmid = 0\nfor i in range(Row):\n  mid += List[i]\nsumList = [mid]* (Row+1)\nfor i in range(Row):\n  sumList[i] = sumList[i]-List[i]\n  if sumList[i] % 10 == 0:\n    sumList[i]=0\nif sumList[Row] % 10 == 0:\n  sumList[Row] = 0\nres = max(sumList)\nprint(res)", "passed": true, "time": 0.14, "memory": 14296.0, "status": "done"}, {"code": "N = int(input())\nA = [0]*N\nfor i in range(N):\n  A[i] = int(input())\n  \nA.sort()\n\nS = sum(A)\nif S%10 != 0:\n  print(S)\n  return\n\nfor i in range(N):\n  if A[i]%10 !=0:\n    print(S-A[i])\n    return\n    \nprint(0)", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "# coding = SJIS\n\nn = int(input())\ns = []\nfor i in range(n):\n    s.append(int(input()))\n\ns.sort()\n\nif sum(s) % 10 != 0:\n    print(sum(s))\n    return\nelse:\n    for i in s:\n        if i % 10 != 0:\n            print(sum(s) - i)\n            return\n\nprint(0)", "passed": true, "time": 0.18, "memory": 14160.0, "status": "done"}, {"code": "# C - Bugged\ndef main():\n    n = int(input())\n    s = [int(input()) for _ in range(n)]\n    s.sort()\n  \n    if sum(s) % 10 != 0:\n        print(sum(s))\n    else:\n        for i in range(n):\n            if s[i] % 10 != 0:\n                print(sum(s)-s[i])\n                return\n        else:\n            print(0)\n\n\nif __name__ ==  \"__main__\":\n    main()", "passed": true, "time": 0.15, "memory": 14336.0, "status": "done"}, {"code": "# coding: utf-8\n\n\ndef main():\n    N = int(input())\n    A = [int(input()) for _ in range(N)]\n    ans = sum(A)\n\n    if ans % 10 == 0:\n        tmp = 0\n        for i in range(N):\n            if A[i] % 10 != 0:\n                tmp = max(tmp, ans - A[i])\n        if tmp % 10 == 0:\n            ans = 0\n        else:\n            ans = tmp\n\n    print(ans)\n\ndef __starting_point():\n    main()\n\n__starting_point()", "passed": true, "time": 0.26, "memory": 14088.0, "status": "done"}, {"code": "n = int(input())\na = 0\nx = 9999\nfor _ in range(n):\n    v = int(input())\n    a += v\n    if v % 10 != 0:\n        x = min(x, v)\nif a % 10 != 0:\n    print(a)\nelse:\n    if x == 9999:\n        # \u305c\u3093\u307610\u3067\u5272\u308a\u5207\u308c\u308b\u306e\u3067\u99c4\u76ee\n        print((0))\n    else:\n        print((a - x))\n", "passed": true, "time": 0.26, "memory": 14232.0, "status": "done"}, {"code": "n = int(input())\ns = [int(input()) for i in range(n)]\ns.sort()\nif sum(s) % 10 != 0:\n    print(sum(s))\nelse:\n    for i in range(n):\n        if s[i] % 10 != 0:\n            print(sum(s)-s[i])\n            return\n    print(0)", "passed": true, "time": 0.15, "memory": 14252.0, "status": "done"}, {"code": "N = int(input())\ndp = [0]\nfor i in range(N):\n    P = int(input())\n    dp_p = list(map(lambda x:x + P,dp))\n    dp = list(set(dp + dp_p))\n\nP_List = [0] + [i for i in dp if i % 10 != 0]\nprint(max(P_List))", "passed": true, "time": 0.15, "memory": 14288.0, "status": "done"}, {"code": "n = int(input())\nnon_10 = [0]\na = []\nfor i in range(n):\n  a.append(int(input()))\n  if a[i] % 10 != 0:\n    non_10.append(a[i])\ns = sum(a)\nnon_10.sort()\nif s % 10 == 0:\n  if len(non_10) > 1:\n    s -= non_10[1]\n  else:\n    s = 0\nprint(s)", "passed": true, "time": 0.14, "memory": 14072.0, "status": "done"}, {"code": "n = int(input())\ns = []\nfor i in range(n):\n    s += [int(input())]\ns = sorted(s)\na = sum(s)\nif a % 10 != 0:\n    print(a)\n    return\nelse:\n    for i in range(n):\n        if s[i] % 10 != 0:\n            a -= s[i]\n        if a % 10 != 0:\n            print(a)\n            f = 0\n            return\n        else:\n            f = 1\nif f:\n    print(0)", "passed": true, "time": 0.14, "memory": 14300.0, "status": "done"}, {"code": "N = int(input())\ns = [int(input()) for _ in range(N)]\n\nxs = [x%10 for x in s]\n\nif xs.count(0) == N:\n  print((0))\nelif sum(s) % 10 != 0:\n  print((sum(s)))\nelse:\n  minimum = 999\n  for n in range(N):\n    if s[n] % 10 != 0:\n      minimum = min(minimum,s[n])\n  print((sum(s)-minimum))\n", "passed": true, "time": 0.14, "memory": 14328.0, "status": "done"}, {"code": "n = int(input())\nargList = [int(input()) for _ in range(n)]\nargList.sort()\nret = sum(argList)\nif ret % 10 == 0:\n    bias = 0\n    for b in argList:\n        if b % 10 != 0:\n            bias = b\n            break\n    if bias == 0:\n        print(0)\n    else:\n        print(ret-bias)\nelse:\n    print(ret)", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "n = int(input())\nx = 0\nmn = 100\nfor i in range(n):\n  s = int(input())\n  x += s\n  if s % 10 != 0:\n    if s <= mn:\n      mn = s\nif x % 10 != 0:\n  print(x)\nelse:\n  x -= mn\n  if x % 10 == 0:\n    print((0))\n  else:\n    if x < 0:\n      print((0))\n      return\n    print(x)\n", "passed": true, "time": 0.14, "memory": 14088.0, "status": "done"}, {"code": "n=int(input())\ns=[]\nfor i in range(n):\n    s.append(int(input()))\ns.sort()\n\nif sum(s)%10==0:\n    for i in range(n):\n        if s[i]%10!=0:\n            print((sum(s)-s[i]))\n            return\n    print((0))\n    return\nprint((sum(s)))\n", "passed": true, "time": 0.14, "memory": 14308.0, "status": "done"}, {"code": "from typing import List\n\n\ndef answer(n: int, s: List[int]) -> int:\n    ans = 0\n    not_multiples_of_10 = []\n\n    for i in s:\n        ans += i\n        if i % 10 != 0:\n            not_multiples_of_10.append(i)\n\n    if not not_multiples_of_10:\n        return 0\n\n    if ans % 10 == 0:\n        ans = ans - min(not_multiples_of_10)\n\n    return ans\n\n\ndef main():\n    n = int(input())\n    s = [int(input()) for _ in range(n)]\n    print(answer(n, s))\n\n\ndef __starting_point():\n    main()\n__starting_point()", "passed": true, "time": 0.15, "memory": 15020.0, "status": "done"}, {"code": "n = int(input())\ns=[]\nfor i in range(n):\n  s.append(int(input()))\ns.sort()\n\nm = -1\nfor i in s:\n  if i % 10 != 0:\n    m = i\n    break\n\nif sum(s) % 10 == 0:\n  if m == -1:\n    print(0)\n  else:\n    print(sum(s) - m)\nelse:\n  print(sum(s))", "passed": true, "time": 0.14, "memory": 14112.0, "status": "done"}, {"code": "n = int(input())\ns = []\nfor i in range(n):\n    s += [int(input())]\ns = sorted(s)\na = sum(s)\nif a % 10 != 0:\n    print(a)\n    return\nelse:\n    for i in range(n):\n        if s[i] % 10 != 0:\n            a -= s[i]\n            if a % 10 != 0:\n                print(a)\n                f = 0\n                return\n        else:\n            f = 1\nif f:\n    print(0)", "passed": true, "time": 0.23, "memory": 14096.0, "status": "done"}, {"code": "N = int(input())\nS = sorted([int(input()) for n in range(N)])\nS1 = []\nS2 = []\n\nfor s in S:\n  if s%10 ==0:\n    S1.append(s)\n  else:\n    S2.append(s)\n    \nif sum(S)%10!=0:\n  print(sum(S))\nelse:\n  if len(S2)>0:\n    print(sum(S)-S2[0])\n  else:\n    print(0)", "passed": true, "time": 0.14, "memory": 14248.0, "status": "done"}, {"code": "n=int(input())\ns=[int(input()) for _ in range(n)]\nans=0\nfor i in range(n):\n  for j in range(i,n):\n    a=sum(s[:i])+sum(s[j:])\n    if a>ans and a%10:\n      ans=a\nprint(ans)", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "n = int(input())\ns = list(int(input()) for _ in range(n))\ns.sort()\n\nif all(num % 10 == 0 for num in s):\n    print(0)\nelse:\n    if sum(s) % 10 == 0:\n        for num in s:\n            if num % 10 != 0:\n                print(sum(s) - num)\n                break\n    else:\n        print(sum(s))", "passed": true, "time": 0.15, "memory": 14056.0, "status": "done"}, {"code": "n = int(input())\n\nl = []\nfor _ in range(n):\n    l.append(int(input()))\n\nl.sort()\nm = sum(l)\n\nif m % 10 != 0:\n    print(m)\nelse:\n    for e in l:\n        if (m - e) % 10 != 0:\n            print((m-e))\n            return\n\n    print((0))\n", "passed": true, "time": 0.14, "memory": 14156.0, "status": "done"}, {"code": "n=int(input())\na=sorted([int(input()) for i in range(n)])\ns=sum(a)\nif s%10!=0:\n    print(s)\nelse:\n    for i in a:\n        if i%10!=0:\n            print(s-i)\n            break\n    else:\n        print(0)", "passed": true, "time": 0.19, "memory": 14304.0, "status": "done"}, {"code": "N = int(input())\nls = []\nfor i in range(N):\n    ls.append(int(input()))\nsum1 = sum(ls)\nls.sort()\nans = 0\nif sum1 % 10 != 0:\n    ans = sum1\nelse:\n    for i in range(N):\n        if (sum1-ls[i]) % 10 != 0:\n            ans = sum1-ls[i]\n            break\nprint(ans)", "passed": true, "time": 0.14, "memory": 14212.0, "status": "done"}, {"code": "'''\nCreated on 2020/10/01\n\n@author: harurun\n'''\nimport sys\npin=sys.stdin.readline\n\ndef main():\n  N=int(pin())\n  su=0\n  S=[]\n  for i in range(N):\n    s=int(pin())\n    S.append(s)\n    su+=s\n  if su%10!=0:\n    print(su)\n    return\n  S.sort()\n  for i in S:\n    if (su-i)%10!=0:\n      print(su-i)\n      return\n  print(0)\n  return\nmain()", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "n = int(input())\ns = [int(input()) for _ in range(n)]\n\nss = sum(s)\nans = ss * min(1, ss % 10)\n\nfor i in range(n):\n    score = ss - s[i]\n\n    ans = max(ans, score * min(1, score % 10))\n\nprint(ans)\n", "passed": true, "time": 0.14, "memory": 14264.0, "status": "done"}, {"code": "import sys\n\ninput = sys.stdin.readline\n\nn = int(input())\n\ns_list = []\nnot_10_s_list = []\n\nfor _ in range(n):\n    s = int(input())\n    if not s % 10 == 0:\n        not_10_s_list.append(s)\n    s_list.append(s)\n\nif len(not_10_s_list) == 0:\n    print(0)\n    return\n\nelse:\n    sum_s = sum(s_list)\n    if not sum_s % 10 == 0:\n        max_s = sum_s\n        print(max_s)\n        return\n\n    max_s = -1\n    for not_10_s in not_10_s_list:\n        if not sum_s - not_10_s % 10 == 0:\n            max_s = max(max_s,sum_s - not_10_s)\n    print(max_s)\n    return", "passed": true, "time": 0.14, "memory": 14104.0, "status": "done"}, {"code": "N = int(input())\nmaxs = 0    \ns = []\nfor i in range(N):\n    cin = int(input())\n    s.append(cin)\n    maxs = max(maxs, cin)\nM = maxs * N\n\ndp = [False] * (M+1)\ndp[0] = True\n\nfor x in s:\n    for i in range(M+1):\n        if M-i < x: continue\n        if dp[M-i-x]: dp[M-i] = True\n\nfor i in range(M+1):\n    if (M-i)%10 != 0 and dp[M-i]:\n        print(M-i)\n        break\nelse:\n    print(0) ", "passed": true, "time": 0.14, "memory": 14076.0, "status": "done"}, {"code": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Tue Sep 22 15:10:57 2020\n\n@author: liang\n\"\"\"\n\nN = int(input())\nlis10 = list()\nlis =list()\nans = 0\nfor i in range(N):\n    s = int(input())\n    if s % 10 == 0:\n        lis10.append(s)\n    else:\n        lis.append(s)\nans += sum(lis10)\nlis.sort()\nans += sum(lis)\nif ans % 10 == 0:\n    if lis:\n        ans -= lis[0]\n    else:\n        ans = 0\nprint(ans)", "passed": true, "time": 0.14, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\ns = []\nSum = 0\nfor i in range(N):\n    s.append(int(input()))\n    Sum += s[i]\ns.sort()\n\nif Sum % 10 != 0:\n    print(Sum)\nelse:\n    for i in range(N):\n        if s[i] % 10 != 0:\n            print(Sum - s[i])\n            break\n        if i == N - 1:\n            print(0) ", "passed": true, "time": 0.13, "memory": 14312.0, "status": "done"}, {"code": "N = int(input())\nten, notten = [], []\nfor i in range(N):\n    s = int(input())\n    ten.append(s) if s%10 == 0 else notten.append(s)\n\nscore = sum(notten)\n\nwhile score % 10 == 0:\n    if len(notten) == 0:\n        break\n    score -= min(notten)\n    notten.remove(min(notten))\n\nif score == 0:\n    print(0)\nelse:\n    print(score+sum(ten))", "passed": true, "time": 0.14, "memory": 14268.0, "status": "done"}]