Harryxun/stf_run huggingface dataset:
N, M = map(int,input().split(' '))
a = [int(input()) for i in range(M)]
for i in range(M-1):
  if a[i]+1 == a[i+1]:
    print(0)
    exit()
def step(n):
  if n == 0 :
    return 1
  elif n == 1 :
    return 2
  tmp = [0]*n
  tmp[0] = 1
  tmp[1] = 2
  for i in range(2,n):
    tmp[i] = tmp[i-2] + tmp[i-1]
  return tmp[n-1]
ans = step(a[0]-1)
for i in range(1,M):
  n = a[i] - a[i-1] - 2
  ans = ans*step(n)
n = N - a[M-1] -1
ans = ans*step(n)

print(ans%(10**9+7))
print([step(i) for i in range(6)])

### FIXED CODE ###

N, M = map(int,input().split(' '))
a = set([int(input()) for i in range(M)])
ans = [0]*(N+1)
ans[0] = 1
for i in range(1,N+1):
  if i in a:
    ans[i] = 0
  else:
    ans[i] = (ans[i-1]+ans[i-2])%(10**9+7)
print(ans[N])
ceil = lambda a, b: -(-a // b)

K, A, B = map(int, input().split())
if A >= K:
    print(1)
    exit()
p = A - B
if p < 0:
    print(-1)
    exit()

ans = 1
ans += ceil(K - A, A - B) * 2
print(ans)


### FIXED CODE ###

ceil = lambda a, b: -(-a // b)

K, A, B = map(int, input().split())
if A >= K:
    print(1)
    exit()
p = A - B
if p <= 0:
    print(-1)
    exit()

ans = 1
ans += ceil(K - A, A - B) * 2
print(ans)
#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
aa=0
s=n//(a+b)
n=n%((a+b)*s)#余り
if n<a:
    print(s*a+n)
else:
    print(s*a+a)

### FIXED CODE ###

#B
import sys
n,a,b=map(int,input().split())
if a==0:
    print(0)
    sys.exit()
else:
    s=int(n/(a+b))
    if s==0:
        m=n
    else:
        absum=(a+b)*s
        m=n%(absum)#余り
    if m<a:
        print(s*a+m)
    else:
        print((s+1)*a)
if 4*a*b < (c-a-b) ** 2 and c-a-b > 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b,c = map(int, input().rstrip().split())
if 4*a*b < (c-a-b) ** 2 and c-a-b > 0:
  print("Yes")
else:
  print("No")
a, b = map(int, input())
print((a+b)%24)

### FIXED CODE ###

a, b = map(int, input().split())
print((a+b)%24)
N = int(input())
X = [None] * N
Y = [None] * N
U = [None] * N
for i in range(N):
  X[i], Y[i], U[i] = input().split()

def main():
  for i in range(N):
    for j in range(N):
      if (i > j):
        continue

      if (U[i] == U[j]):
        continue

      if (U[i] == 'U' and U[j] == 'R'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(Y[i])):
          return(abs((int(Y[j]) - int(Y[i]))*10))

      if (U[i] == 'U' and U[j] == 'D'):
        if (int(X[i]) == int(X[j])) and (int(Y[i]) < int(Y[j])) and (int(Y[i]) - int(Y[j])) % 2 == 0:
          return(abs((int(Y[i]) - int(Y[j]))*5))

      if (U[i] == 'U' and U[j] == 'L'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          return(abs((int(Y[i]) - int(Y[j]))*10))

      if (U[i] == 'R' and U[j] == 'U'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          return(abs((int(X[j]) - int(X[i]))*10))

      if (U[i] == 'R' and U[j] == 'D'):
        if (int(X[j]) > int(X[i]) and int(X[j]) - int(X[i]) == int(Y[j]) - int(Y[i])):
          return(abs((int(X[j]) - int(X[i]))*10))

      if (U[i] == 'R' and U[j] == 'L'):
        if (int(Y[i]) == int(Y[j])) and (int(X[i]) < int(X[j])) and (int(X[i]) - int(X[j])) % 2 == 0:
          return(abs((int(X[i]) - int(X[j]))*5))

      if (U[i] == 'D' and U[j] == 'U'):
        if (int(X[i]) == int(X[j])) and (int(Y[i]) > int(Y[j])) and (int(Y[i]) - int(Y[j])) % 2 == 0:
          return(abs((int(Y[i]) - int(Y[j]))*5))

      if (U[i] == 'D' and U[j] == 'R'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[i]) - int(X[j])):
          return(abs((int(Y[i]) - int(Y[j]))*10))

      if (U[i] == 'D' and U[j] == 'L'):
        if (int(Y[i]) > int(Y[j]) and int(Y[i]) - int(Y[j]) == int(X[j]) - int(X[i])):
          return(abs((int(Y[i]) - int(Y[j]))*10))

      if (U[i] == 'L' and U[j] == 'U'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[i]) - int(Y[j])):
          return(abs((int(X[i]) - int(X[j]))*10))
      
      if (U[i] == 'L' and U[j] == 'D'):
        if (int(X[i]) > int(X[j]) and int(X[i]) - int(X[j]) == int(Y[j]) - int(Y[i])):
          return(abs((int(X[i]) - int(X[j]))*10))

      if (U[i] == 'L' and U[j] == 'R'):
        if (int(Y[i]) == int(Y[j])) and (int(X[i]) > int(X[j])) and (int(X[j]) - int(X[i])) % 2 == 0:
          return(abs((int(X[j]) - int(X[i]))*5))

  return('SAFE')

print(main())


### FIXED CODE ###

x = int(input())

if (400 <= x <= 599):
  print(8)
elif (600 <= x <= 799):
  print(7)
elif (800 <= x <= 999):
  print(6)
elif (1000 <= x <= 1199):
  print(5)
elif (1200 <= x <= 1399):
  print(4)
elif (1400 <= x <= 1599):
  print(3)
elif (1600 <= x <= 1799):
  print(2)
elif (1800 <= x <= 1999):
  print(1)
a,b = map(int, raw_input())
print (a + b) % 24

### FIXED CODE ###

a,b = map(int, raw_input().split())
print (a + b) % 24
from decimal import *
A, B = input().split()
A = Decimal(A)
B = Decimal(B * 100)
print(A * B // 100)

### FIXED CODE ###

from decimal import *
A, B = input().split()
A = Decimal(A)
B = Decimal(B)
print(int(A * B))
import numpy as np
N=int(input())
s=np.array(list(map(int,input().split())))

d_even=np.zeros(10)
d_odd=np.zeros(10)

for i in range(N//2):
    d_even[s[2*i]]+=1
    d_odd[s[2*i+1]]+=1
    
se=np.argsort(d_even)[::-1]
so=np.argsort(d_odd)[::-1]

e1=se[0]
e2=se[1]
o1=so[0]
o2=so[1]

if e1!=o1:
    ans=N-d_even[e1]-d_odd[o1]
else:
    ans=min(N-d_even[e1]-d_odd[o2],N-d_even[e2]-d_odd[o1])     
        
print(int(ans))

### FIXED CODE ###

import numpy as np
N=int(input())
s=np.array(list(map(int,input().split())))

d_even=np.zeros(np.max(s)+1)
d_odd=np.zeros(np.max(s)+1)

for i in range(N//2):
    d_even[s[2*i]]+=1
    d_odd[s[2*i+1]]+=1
    
se=np.argsort(d_even)[::-1]
so=np.argsort(d_odd)[::-1]

e1=se[0]
e2=se[1]
o1=so[0]
o2=so[1]

if e1!=o1:
    ans=N-d_even[e1]-d_odd[o1]
else:
    ans=min(N-d_even[e1]-d_odd[o2],N-d_even[e2]-d_odd[o1])     
        
print(int(ans))
while True:
        x = raw_input();
        sum = 0
        if x == 0:
                break
        for i in (x):
                print i

### FIXED CODE ###

while True:
        x = raw_input();
        sum = 0
        if int(x) == 0:
                break
        for i in (x):
                sum += int(i)
        print sum
a,b,c,d,e,f=map(int,input().split())
a *=100
b *=100

DP=[-1 for _ in range(f+1)]
DP[a],DP[b]=0,0
for i in range(f+1):
    if DP[i]==-1:continue
    for j in a,b:
        if i+j<=f:DP[i+j]=DP[i]
    for j in c,d:
        if i+j<=f and 100*(DP[i]+j)/(i+j)<=100*e/(100+e):
            DP[i+j]=DP[i]+j

ans,water=0,[a,0]
for i,j in enumerate(DP):
    if i==0:continue
    if ans<100*j/i:
        ans=100*j/i
        water=[i,j]
print(*water)

### FIXED CODE ###

inf=10**8
a,b,c,d,e,f=map(int,input().split())
a,b=100*a,100*b
DP=[inf]*(f+max(a,b)+1)
DP[a],DP[b]=0,0

for i in range(f+1):
    if DP[i]!=inf:
        DP[i+a]=DP[i]
        DP[i+b]=DP[i]
        for j in c,d:
            if 100*(DP[i]+j)/(i+j)<=100*e/(100+e):
                DP[i+j]=max(DP[i],DP[i]+j)

ans,index=0,[a,0]
for i in range(f+1):
    if DP[i]!=inf:
        if ans<100*DP[i]/i:
            ans=100*DP[i]/i
            index=[i,DP[i]]

print(*index)
n = input()
a  list(map(int,input().split()))

a = sorted(a)

if sum(a[0:-1]) > a[-1]:
  print("No")
else:
  print("Yes")


### FIXED CODE ###

n = input()
a = list(map(int,input().split()))

a = sorted(a)

if sum(a[0:-1]) <= a[-1]:
  print("No")
else:
  print("Yes")
import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,k = map(int,input().split())
for i in range(1,k+1):
  print(comb(n - k + 1,i) * comb(k-1,i-1) % (10**9 + 7))

### FIXED CODE ###

import math
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n,k = map(int,input().split())
for i in range(1,k+1):
    if n - k + 1 >= i:
      print(comb(n - k + 1,i) * comb(k-1,i-1) % (10**9 + 7))
    else:
      print(0)
import numpy as np

s = input()[::-1]

dp = np.zeros((len(s),13))

if s[0] =="?":
    dp[0] = [1]*10+[0]*3
else:
    dp[0][int(s[0])] =1

L1 = range(1, len(s))

mod = 1
for i in L1:
    if s[i] == "?":
        mod = (mod*10)%13
        mod_list = ((mod*i)%13 for i in range(10))
        for j in mod_list:
            dp[i, :] += np.roll(dp[i - 1, :], j)
        dp[i, :] %= (10**9+7)
    else:
        mod = (mod*10)%13
        dp[i, :] += np.roll(dp[i - 1, :], (mod * int(s[i]))%13)

print(int(dp[-1][5])%(10**9+7), aaa)


### FIXED CODE ###

s=input()
l=len(s)

mod=10**9+7

dp=[[0 for j in range(13)] for i in range(l)]

if s[0] =="?":
    dp[0] = [1]*10+[0]*3
else:
    dp[0][int(s[0])] =1

for i in range(1, l):
 if s[i]=='?':
   for j in range(10):
     for k in range(13):
       dp[i][(k*10+j)%13]+=dp[i-1][k]%mod
 else:
   for k in range(13):
     dp[i][(k*10+int(s[i]))%13]+=dp[i-1][k]%mod
print(dp[-1][5]%mod)
i = 0
while True:
    x = int(input())
    if x == 0: break
    i = i + 1
    print("Case " + str(i) + ": " + str(x))



### FIXED CODE ###

i = 1
while True:
 x =int(input())
 if x == 0:
  break
 print("Case {}: {}".format(i,x))
 i = i+1
def main():
    n = int(input())
    a = list(map(int, input().split()))


    a.append(0)
    a.insert(0, 0)
    costs = []
    for i in range(n + 1):
        costs.append(abs(a[i + 1] - a[i]))

    s = sum(costs)
    for i in range(n):
        print(s - costs[i] - costs[i + 1] + abs(a[i] - a[i + 2]))

main()

### FIXED CODE ###

a, b, c, d = map(int, [input() for i in range(4)])
print(min([a, b]) + min([c, d]))
def circle_in_rectangle(radius, pos, height, width):
    """
    radius: float
    pos: tuple, (x, y)
    height: float, height of rectangle
    width: float, width of rectangle

    returns True if circle is in rectangle, otherwise False

    >>> circle_in_rectangle(1, (1, 1), 4, 5)
    True
    >>> circle_in_rectangle(1, (2, 4), 4, 5)
    False
    """
    (x, y) = pos
    if x < radius or x > width - radius:
        return False

    if y < radius or y > height - radius:
        return False

    return True

(w, h, x, y, r) = input().split(' ')
if circle_in_rectangle(r, (x, y), h, w):
    print('Yes')
else:
    print('No')

### FIXED CODE ###

def circle_in_rectangle(radius, pos, height, width):
    """
    radius: int
    pos: tuple, (x, y)
    height: int, height of rectangle
    width: int, width of rectangle

    returns True if circle is in rectangle, otherwise False

    >>> circle_in_rectangle(1, (1, 1), 4, 5)
    True
    >>> circle_in_rectangle(1, (2, 4), 4, 5)
    False
    """
    (x, y) = pos
    if x < radius or x > width - radius:
        return False

    if y < radius or y > height - radius:
        return False

    return True

if __name__ == '__main__':
    #import doctest
    #doctest.testmod()

    (w, h, x, y, r) = input().split(' ')

    if circle_in_rectangle(int(r), (int(x), int(y)), int(h), int(w)):
        print('Yes')
    else:
        print('No')
N ,K = map(int, input().split())
S = input()

s=list(S)
if s[K]=="A":
    s[K]='a'
elif s[K]=='B':
    s[K]='b'
elif s[K]=='C':
    s[K]='c'
print(s)

### FIXED CODE ###

N ,K = map(int, input().split())
S = input()

K -= 1

s=list(S)
if s[K]=="A":
    s[K]='a'
elif s[K]=='B':
    s[K]='b'
elif s[K]=='C':
    s[K]='c'

print(''.join(s))
s = list(map(int, input().split('/')))
if s[0] = 2018 and s[1] > 4:
  print("TBD")
elif s[0] >2018:
  print("TBD")
else : print("Heisei")

### FIXED CODE ###

s = list(map(int, input().split('/')))
if s[0] == 2019 and s[1] > 4:
  print("TBD")
elif s[0] >2019:
  print("TBD")
else : print("Heisei")
n = int(input())
x = list(map(int, input().split()))
sx = sorted(x)

min_mid = sx[int(n/2-1)]
max_mid = sx[int(n/2)]

for i in x:
    if i <= min_mid:    # 左半分から取られてる時
        print(max_mid)
    else:               # 右半分から取られてる時
        print(min_mid)


### FIXED CODE ###

a, b , x = map(int, input().split())

if x >= a and x <= a+b:
    print("YES")
else:
    print("NO")
N=int(input())
H= map(int, input().split())
for i in range(N-1)
    if H[i+1] < H[i]:
        print(No)
    else:
        print(Yes)

### FIXED CODE ###

N=int(input())
H=list(map(int, input().split()))
Z=0
count=0
for i in range(N-1):
    A=H[i+1]
    B=H[i]-1
    if A < B:
        print('No')
        Z=Z+1
        break
    if A == B:
        count=count+1
        if count >=2 and A < C:
            print('No')
            Z=Z+1
            break
        else:
            C=A
if Z == 0:
    print('Yes')
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a


x,n = map(int,input().split())
fct = factorize(n)


divlist=[]
for div in divisorize(fct):
    divlist.append(num(div))

divlist.sort()
ans = 1
for i in range(0,len(divlist)):
    if divlist[i] <= n/x:
        ans = divlist[i]
print(ans)

### FIXED CODE ###




def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


def divisorize(fct):
    b, e = fct.pop()  # base, exponent
    pre_div = divisorize(fct) if fct else [[]]
    suf_div = [[(b, k)] for k in range(e + 1)]
    return [pre + suf for pre in pre_div for suf in suf_div]


def num(fct):
    a = 1
    for base, exponent in fct:
        a = a * base**exponent
    return a


x,n = map(int,input().split())
if x == 1 and n == 1:
    print(1)
    exit()
fct = factorize(n)


divlist=[]
for div in divisorize(fct):
    divlist.append(num(div))

divlist.sort()
ans = 1
for i in range(0,len(divlist)):
    if divlist[i] <= n/x:
        ans = divlist[i]
print(ans)
N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        L = a
        R = b
        count = 1
    else:
        if L < a and a<R:
            L =a
        else:
            break
        if R > b and L < b:
            R = b
        else:
            break
if M == i+1:
    print(max-min+1)
else:
    print(0)

### FIXED CODE ###

N,M = map(int,input().split())
count = 0
for i in range(M):
    a,b = map(int,input().split())
    if count == 0:
        L = a
        R = b
        count = 1
    else:
        if L < a:
            L =a
            if L>R:
                break
        if R > b:
            R = b
            if R < L:
                break
if M == i+1:
    print(R-L+1)
else:
    print(0)
import math
import bisect
import heapq
from collections import deque

n, m = map(int, input().split())

a = list(map(int, input().split()))


def lcm(x, y):
    return x * y // math.gcd(x, y)


def scm(a):
    for i in a:
        if i % 2 == 1:
            return 0
    l = 1
    for i in range(n):
        a[i] = a[i] // 2
        l = lcm(l,a[i])

    count = 0
    lc = l
    if not 1 <= l <= m:
        return 0

    for i in range(l, m+1, 2*lc):
        count += 1

    return count

print(scm(a))



### FIXED CODE ###

from fractions import gcd
n, m = map(int, input().split())

a = list(map(int, input().split()))

ans = -1
b = [0] * n
for i in range(n):
    if a[i] % 2 != 0:
        ans = 0
        break

    else:
        b[i] = a[i] // 2


    if i == 0:
        num = format(a[i], 'b')[::-1].find('1')

    else:
        if format(a[i], 'b')[::-1].find('1') != num:
            ans = 0
            break
        else:
            num = format(a[i], 'b')[::-1].find('1')


if ans != 0:
    g = b[0]
    for i in range(1,n):

        g = (g*b[i]) // gcd(b[i],g)

    if g > m: ans = 0
    else:
        ans = (1 + (m-g)//(2*g))

print(ans)
s = input()

letters = []
for i in range(n):
  if not s[0] in letters:
    letters.append(s[0])
  
if len(letters)==2 and letters.count(s[0])==2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

s = input()

letters = []
for i in range(4):
  if not s[i] in letters:
    letters.append(s[i])
  
if len(letters)==2 and s.count(s[0])==2:
  print('Yes')
else:
  print('No')
A, B = list(map(int,input().split()))
print(int(A*B))

### FIXED CODE ###

A, B = input().split()
A = int(A)
B = B.replace(".", "")
B = int(B)
AB = A*B
AB = str(AB)
AB = "00" + AB
AB = AB[:-2]
print(int(AB))
i = input()
out = 3*i*i
print(out)

### FIXED CODE ###

i = int(input())
out = 3*i*i
print(out)
N=int(input())
if n%2==0:
  print((n/2)-1)
else:
  print((n-1)/2)


### FIXED CODE ###

n=int(input())
if n%2==0:
  print(int((n/2)-1))
else:
  print(int((n-1)/2))
import sys

def solve(n, k, as):
        return n/(k-1)

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as])

def main():
    n, k, as = readQuestion()
    answer = solve(n, k, as)
    print(answer)
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

def solve(n, k, as1):
    if (n-1)%(k-1)==0:
        return (n-1)//(k-1)
    else:
        return (n-1)//(k-1)+1

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as1 = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as1])

def main():
    n, k, as1 = readQuestion()
    answer = solve(n, k, as1)
    print(answer)
    
if __name__ == '__main__':
    main()
n = int(sin.readline())
stones = [int(i) for i in sin.readline().split()]
minCost = [float('inf') for i in range(n)]
minCost[0] = 0
minCost[1] = abs(stones[0] - stones[1])

for i in range(2, len(stones)):
    minCost[i] = min(minCost[i-1] + abs(stones[i-1] - stones[i]),
                     minCost[i-2] + abs(stones[i-2] - stones[i]))

print(minCost)
print(minCost[n-1])

### FIXED CODE ###

import sys
import math
import functools
from collections import deque
sin = sys.stdin

n = int(sin.readline())
stones = [int(i) for i in sin.readline().split()]
minCost = [float('inf') for i in range(n)]
minCost[0] = 0
minCost[1] = abs(stones[0] - stones[1])

for i in range(2, len(stones)):
    minCost[i] = min(minCost[i-1] + abs(stones[i-1] - stones[i]),
                     minCost[i-2] + abs(stones[i-2] - stones[i]))

print(minCost[n-1])
import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    a_sum = []
    b_sum = []
    for i in range(1, len(a)+1):
        a_sum.append(sum(a[0:i]))
    for i in range(1, len(b)+1):
        b_sum.append(sum(b[0:i]))

    ans = 0
    j = m - 1
    for i in range(n):
        if a_sum[i] > k:
            break
        while b_sum[j] > k - a_sum[i]:
            j -= 1
        print(i, j)
        ans = max(ans, (i+1)+(j+1))

    print(ans)


if __name__ == '__main__':
    main()


### FIXED CODE ###

import itertools
import math
import fractions
import functools
import copy
from collections import deque
from functools import reduce
from decimal import Decimal


def main():
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))

    a_sum = [0]
    b_sum = [0]
    for i in range(len(a)):
        a_sum.append(a_sum[i]+a[i])
    for i in range(len(b)):
        b_sum.append((b_sum[i]+b[i]))

    ans = 0
    j = m
    for i in range(n+1):
        if a_sum[i] > k:
            break
        while b_sum[j] > k - a_sum[i]:
            j -= 1
        ans = max(ans, (i+j))

    print(ans)


if __name__ == '__main__':
    main()
N = int(input())
s = [int(input()) for _ in range(N)]

result = sum(s)

if result % 10 == 0:
    while True:
        min_s = min(s)
        if min_s % 10 == 0:
            s.remove(min_s)
        else:
            result -= min_s
            break

print(result)


### FIXED CODE ###

N = int(input())
s = [int(input()) for _ in range(N)]

result = sum(s)

if result % 10 == 0:
    for _ in range(N):
        min_s = min(s)
        if min_s % 10 == 0:
            s.remove(min_s)
        else:
            result -= min_s
            break

    if result % 10 == 0:
        result = 0

print(result)
# -*- coding: utf-8 -*-
# from collections import deque
# from sys import setrecursionlimit

# setrecursionlimit(1000000)


# INF = float("inf")

# d = deque()
# ---Input---#
n = int(input())
# n, k = map(int, input().split())
p = list(map(float, input().split()))
p = [-1] + p

memo = [[-1 for _ in [0] * (n + 1)] for _ in [0] * (n + 1)]
memo[0][0] = 1
for i in range(len(p))[1:]:
    memo[0][i] = 0
    memo[i][0] = memo[i - 1][0] * (1 - p[i])
memo[0][0] = 1


def dp(i, j):
    if memo[i][j] == -1:
        memo[i][j] = dp(i - 1, j) * (1 - p[i]) + dp(i - 1, j - 1) * p[i]
    return memo[i][j]


ans = 0
tar = int(n / 2) + 1
for i in range(n + 1)[tar:]:
    ans += dp(n, i)


print("{}".format(ans))


### FIXED CODE ###

# -*- coding: utf-8 -*-
# from collections import deque
from sys import setrecursionlimit

setrecursionlimit(1000000)


# INF = float("inf")

# d = deque()
# ---Input---#
n = int(input())
# n, k = map(int, input().split())
p = list(map(float, input().split()))
p = [-1] + p

memo = [[-1 for _ in [0] * (n + 1)] for _ in [0] * (n + 1)]
memo[0][0] = 1
for i in range(len(p))[1:]:
    memo[0][i] = 0
    memo[i][0] = memo[i - 1][0] * (1 - p[i])
memo[0][0] = 1


def dp(i, j):
    if memo[i][j] == -1:
        memo[i][j] = dp(i - 1, j) * (1 - p[i]) + dp(i - 1, j - 1) * p[i]
    return memo[i][j]


ans = 0
tar = int(n / 2) + 1
for i in range(n + 1):
    dp(i, i)
    dp(i, n)

for i in range(n + 1)[tar:]:
    ans += dp(n, i)


print("{}".format(ans))
N, M, X = list(map(int, input().split()))
CA = [list(map(int, input().split())) for i in range(N)]

set_list = []
for i in range(2 ** N):
    select = []
    for j in range(N):
        if ((i >> j) & 1):
            select.append(j)
    if len(select) != 0:
        set_list.append(select)
    
cost = []
for i in range(2 ** N - 1):
    cost.append(sum([CA[set_list[i][j]][0] for j in range(len(set_list[i]))]))

skill = []
for i in range(2 ** N - 1):
    tmp = [0]*M
    for j in set_list[i]:
        for k in range(M):
            tmp[k] += CA[j][k+1]
    skill.append(tmp)

pool = []
for i in range(2**N - 1):
    flag = 0
    for j in skill[i]:
        if j < X:
            flag = 1
    if flag == 0:
        pool.append(cost[i])
        

print(min(pool))


### FIXED CODE ###

N, M, X = list(map(int, input().split()))
CA = [list(map(int, input().split())) for i in range(N)]

set_list = []
for i in range(2 ** N):
    select = []
    for j in range(N):
        if ((i >> j) & 1):
            select.append(j)
    if len(select) != 0:
        set_list.append(select)
    
cost = []
for i in range(2 ** N - 1):
    cost.append(sum([CA[set_list[i][j]][0] for j in range(len(set_list[i]))]))

skill = []
for i in range(2 ** N - 1):
    tmp = [0]*M
    for j in set_list[i]:
        for k in range(M):
            tmp[k] += CA[j][k+1]
    skill.append(tmp)

pool = []
for i in range(2**N - 1):
    flag = 0
    for j in skill[i]:
        if j < X:
            flag = 1
    if flag == 0:
        pool.append(cost[i])
        

if len(pool) == 0:
	print(-1)
else:
    print(min(pool))
import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
c.sort()
ans = 0
for i in b:
  ans += bisect.bisect_left(a,x)*(n-bisect.bisect_right(c,x))
print(ans)

### FIXED CODE ###

import bisect
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
c.sort()
ans = 0
for x in b:
  ans += bisect.bisect_left(a,x)*(n-bisect.bisect_right(c,x))
print(ans)