Harryxun/stf_run huggingface dataset:
#coding:utf-8
import sys
sys.setrecursionlimit(2**31-1)
input = sys.stdin.readline
write = sys.stdout.write
LMIIS = lambda : list(map(int,input().split()))
II = lambda : int(input())
dbg = lambda *something : print(*something) if DEBUG is True else 0
DEBUG = True

def main():
    A,B = LMIIS()
    #001 - 010 - 011 - 100 - 101 - 110 -> 111 diff 101
    #000 - 001 - 010 - 011 - 100 - 101 -> 001 diff 101
    # 0 0 1
    # 0 1 1
    # 1 0 0 
    # 1 1 0

    # 00
    # 01 
    # 10
    # 11

    Abin = []
    Bbin = []

    diff = abs(A-B)
    Atmp = A
    while Atmp:
        Abin.append(Atmp % 2)
        Atmp //= 2

    Btmp = B
    while Btmp:
        Bbin.append(Btmp % 2)
        Btmp //= 2
    
    Abin += [0] * (len(Bbin) - len(Abin))
    Bbin += [0] * (len(Abin) - len(Bbin))
    
        
    
    
    #print(Abin,Bbin)

    ans = [0] * len(Abin)
    ans[0] = Abin[0]
    tmp = A
    j = 1

    # 0桁目
    if diff % 2 == 1:
        ans[0] = 1
    if diff // 2 % 2 == 1:
        ans[0] ^= 1   

    # 2**i桁目
    for i in range(1,len(Abin)):
        # 周期：2**(i+1)
        for _ in range(diff % 2**(i+1) - j + 1):
            tmp ^= A+j
            j += 1
        ans[i] = tmp // 2 ** i % 2
    
    v = 0
    for i in range(len(ans)-1,-1,-1):
        v *= 2
        v += ans[i]
    print(v)

    # print('gutyoku')
    # r = A
    # for i in range(A+1,B+1):
    #     r ^= i
    # print(r)
    







if __name__ == '__main__':
    main()

### FIXED CODE ###

#coding:utf-8
import sys,os
from collections import defaultdict, deque
from math import gcd, ceil, floor
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    MOD = 10**9+7

    A,B = LMIIS()
    if A & 1:
        if B & 1:
            #A, (A+1 A+2).....(B-1,B)
            print(A^(B-A)//2%2)
        else:
            #A, (A+1 A+2).....(B-2,B-1),B
            print(A^((B-A-1)//2%2)^B)
    else:
        if B & 1:
            #(A, A+1).....(B-1,B)
            print((B-A+1)//2%2)
        else:
            #(A, A+1).....(B-2,B-1),B
            print((B-A)//2%2^B)



    

if __name__ == '__main__':
    main()
N = int(input().split())

if N < 1000:
    print('ABC')
else:
    print('ABD')


### FIXED CODE ###

N = int(input())

if N < 1000:
    print('ABC')
else:
    print('ABD')
n = int(input())
x = input()

original_pop_count = x.count('1')
one_pop_count = original_pop_count - 1 # 0になりうる
zero_pop_count = original_pop_count + 1

one_mod = 0
zero_mod = 0
for b in x:
    if one_pop_count != 0:
        one_mod = (one_mod * 2 + int(b)) % one_pop_count
    zero_mod = (zero_mod * 2 + int(b)) % zero_pop_count

# f の前計算
f = [0] * 220000
pop_count = [0] * 220000
for i in range(1, 220000):
    pop_count[i] = pop_count[i // 2] + i % 2
    f[i] = f[i % pop_count[i]] + 1

# pow2 の前計算
one_pow2 = [1] * 220000
zero_pow2 = [1] * 220000
for i in range(1, 220000):
    if one_pop_count != 0:
        one_pow2[i] = one_pow2[i - 1] * 2 % one_pop_count
    zero_pow2[i] = zero_pow2[i - 1] * 2 % zero_pop_count

# n-1, n-2, ..., 0
for i in range(n-1, -1, -1):
    if x[n-i-1] == '1':
        if one_pop_count != 0:
            nxt = one_mod
        # nxt -= pow(2, i, one_pop_count)
            nxt -= one_pow2[i]
            nxt %= one_pop_count
            print(f(nxt) + 1)
        else:
            print(0)
    elif x[n-i-1] == '1':
        nxt = zero_mod
        # nxt += pow(2, i, zero_pop_count)
        nxt += zero_pow2[i]
        nxt %= zero_pop_count
        print(f(nxt) + 1)

### FIXED CODE ###

n = int(input())
x = input()

original_pop_count = x.count('1')
one_pop_count = original_pop_count - 1 # 0になりうる
zero_pop_count = original_pop_count + 1

one_mod = 0
zero_mod = 0
for b in x:
    if one_pop_count != 0:
        one_mod = (one_mod * 2 + int(b)) % one_pop_count
    zero_mod = (zero_mod * 2 + int(b)) % zero_pop_count

# f の前計算
f = [0] * 220000
pop_count = [0] * 220000
for i in range(1, 220000):
    pop_count[i] = pop_count[i // 2] + i % 2
    f[i] = f[i % pop_count[i]] + 1

# pow2 の前計算
one_pow2 = [1] * 220000
zero_pow2 = [1] * 220000
for i in range(1, 220000):
    if one_pop_count != 0:
        one_pow2[i] = one_pow2[i - 1] * 2 % one_pop_count
    zero_pow2[i] = zero_pow2[i - 1] * 2 % zero_pop_count

for i in range(n-1, -1, -1):
    if x[n-i-1] == '1':
        if one_pop_count != 0:
            nxt = one_mod
        # nxt -= pow(2, i, one_pop_count)
            nxt -= one_pow2[i]
            nxt %= one_pop_count
            print(f[nxt] + 1)
        else:
            print(0)
    elif x[n-i-1] == '0':
        nxt = zero_mod
        # nxt += pow(2, i, zero_pop_count)
        nxt += zero_pow2[i]
        nxt %= zero_pop_count
        print(f[nxt] + 1)
s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if lis[0]>=lo:
  lo=lis[j]
if le-lis[-1]-1>=lo:
  lo=le-lis[-1]-1
print(lo)

### FIXED CODE ###

s=input()
le=len(s)
lis=[]
for i in range(0,le):
  if s[i]!="A" and s[i]!="C" and s[i]!="T" and s[i]!="G":
    lis.append(i)
lo=0
for j in range(0,len(lis)-1):
  if lis[j+1]-lis[j]-1>=lo:
    lo=lis[j+1]-lis[j]-1
if bool(lis):
  if lis[0]>=lo:
    lo=lis[0]
  if le-lis[-1]-1>=lo:
    lo=le-lis[-1]-1
  print(lo)
else:
  print(le)
days=["MON","TUE","WED","THU","FRI","SAT","SUN"]
s=input()
for k,i in enumerate days:
  if(s=="SUN"):
    print(7)
  elif(s==i)
    print(6-k)


### FIXED CODE ###

k=["MON","TUE","WED","THU","FRI","SAT"]
s=input()
j="SUN"
if(s==j):
  print(7)
else:
  for a,i in enumerate (k):
    if(s==i):
      print(6-a)
n,m=map(int,input().split())
a=[int(input())-1 for i in range(m)]
a=set(a)
mod=10**9+7
dp=[0]*n
dp[0]=1
if a[0]==1:
  dp[1]=0
else:
  dp[1]=1
for i in range(2,n):
  if i in a:
    dp[i]=0
  else:
    dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[n-1])

### FIXED CODE ###

n,m=map(int,input().split())
a=set()
for i in range(m):
  a.add(int(input()))
mod=10**9+7
dp=[0]*(n+1)
dp[0]=1
if 1 in a:
  dp[1]=0
else:
  dp[1]=1
if n==1:
  print(dp[1])
  exit()
if 2 in a:
  dp[2]=0
else:
  dp[2]=dp[1]+1
for i in range(3,n+1):
  if i in a:
    dp[i]=0
  else:
    dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[n])
N, M = map( int, input().split())
A = list( map( int, input().split()))
Needs = [0,2,5,5,4,5,6,3,7,6]
A.sort(reverse = True)
V = [0]*N
Check = []
for a in A:
    if V[Needs[a]] == 0:
        Check.append(Needs[a])
        V[Needs[a]] = a
Check.sort()
dp = [0]*(N+1)
for x in Check:
    dp[x] = 1
for i in range(1,N):
    t = dp[i]
    if t == 0:
        continue
    for x in Check:
        if x + i <= N:
            if dp[x+i] < t + 1:
                dp[x+i] = t+1
now = dp[N]
ans = ""
t = N
W = [0]*10
while t > 0:
    # k += 1
    # if k >= 100:
    #     print(dp,t)
    #     print([i for i in range(N)])
    #     break
    for x in Check:
        if dp[t-x] == 0 and t-x >0:
            continue
        if dp[t-x]+1 == dp[t]:
            W[V[x]] += 1
            t -= x
            break
for i in range(9,0,-1):
    ans += str(i)*W[i]
print(ans)


### FIXED CODE ###

N, M = map( int, input().split())
A = list( map( int, input().split()))
Needs = [0,2,5,5,4,5,6,3,7,6]
A.sort(reverse = True)
V = [0]*10
Check = []
for a in A:
    if V[Needs[a]] == 0:
        Check.append(Needs[a])
        V[Needs[a]] = a
Check.sort()
dp = [-100000]*(N+1)
dp[0] = 0

for x in Check:
    if x <= N:
        dp[x] = 1
for i in range(1,N):
    t = dp[i]
    for x in Check:
        if x + i <= N:
            if dp[x+i] < t + 1:
                dp[x+i] = t+1
ans = ""
t = N
W = [0]*10
while t > 0:
    for a in A:
        x = Needs[a]
        if t-x>=0:
            if dp[t-x]+1 == dp[t]:
                W[V[x]] += 1
                t -= x
                break
for i in range(9,0,-1):
    ans += str(i)*W[i]
print(ans)
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


# import time, random
# start = time.time()

D = int(input())
c = list(map(int, input().split()))
s = [None]*D
for i in range(D):
    s[i] = list(map(int, input().split()))
    
current = [0]*26
ans = [None]*D
def greedy(weight=1.0):
    ans = [None]*D
    for i,ss in enumerate(s):
        vs = [None]*26
        for j in range(26):
            vs[j] = (ss[j] + current[j]*weight, j)
            current[j] += c[j]
        vs.sort()
        v = vs[-1][1]
        ans[i] = v+1
        current[v] = 0
    return ans
def val(ans):
    current = [0]*26
    val = 0
    for i,(ss, v) in enumerate(zip(s, ans)):
        for j in range(26):
            current[j] += c[j]
        current[v-1] = 0
        val += ss[i] - sum(current)
    return val

ans = greedy()
best = ans
bval = val(ans)
num = 2
ren = 0
w = 1.0

for w in range(100, 500, 10):
    weight = w/100
    tmpans = greedy(weight)
    tmpval = val(tmpans)
    if tmpval>bval:
        bval = tmpval
        best = tmpans
#         print(bval)
    
write("\n".join(map(str, best)))

### FIXED CODE ###

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


D = int(input())
c = list(map(int, input().split()))
s = [None]*D
for i in range(D):
    s[i] = list(map(int, input().split()))
    
current = [0]*26
ans = [None]*D
def greedy():
    ans = [None]*D
    for i,ss in enumerate(s):
        vs = [None]*26
        for j in range(26):
            vs[j] = (ss[j] + current[j], j)
            current[j] += c[j]
        vs.sort()
        v = vs[-1][1]
        ans[i] = v+1
        current[v] = 0
    return ans
ans = greedy()
write("\n".join(map(str, ans)))
k,s = map(int,input().split())
count = 0
for i in range(k+1):
    for j in range(k+1):
        if s-(i+j) <= k and s-(i+j) >= 0:
            count += 1
print(count)


### FIXED CODE ###

line = input()
print(line.replace(","," "))
n = int(input())
a = list(map(int,input().split()))

ad = dict((i, a.count(i)) for i in set(a))

for i in range(n):
  ans = 0
  for v in list(ad):
    ans += ad[v]*(ad[v]-1)//2 if a[v] != v else (ad[v]-1)*(ad[v]-2)//2
   
  print(ans)

### FIXED CODE ###

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

ad = {}
for i in range(n) :
    if a[i] in ad :
        ad[a[i]] += 1
    else :
        ad[a[i]] = 1

ans = 0
for v in ad.values():
    ans += v*(v-1)//2

for i in range(n):
    v = ad[a[i]]
    print(ans-v*(v-1)//2+(v-1)*(v-2)//2)
import math
def multi_lcm(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = ans * a[i] // fractions.gcd(ans, a[i])
    return ans

N = int(input())
T = [int(input()) for _ in range(N)]
print(multi_lcm(T))


### FIXED CODE ###

import fractions
def multi_lcm(a):
    ans = a[0]
    for i in range(1, len(a)):
        ans = ans * a[i] // fractions.gcd(ans, a[i])
    return ans

N = int(input())
T = [int(input()) for _ in range(N)]
print(multi_lcm(T))
D=input()
	if D.isupper():
		print("A")
	else:
		print("a")

### FIXED CODE ###

D=input()
if str.isupper(D):
	print("A")
else:
	print("a")
a, b, c, d, e = map(int, input().split())
if a == 0:
    print(1)
elif b == 0:
    print(2)
elif c == 0:
    print(3)
elif e == 0:
    print(4)
elif f == 0:
    print(5)


### FIXED CODE ###

a, b, c, d, e = map(int, input().split())
if a == 0:
    print(1)
elif b == 0:
    print(2)
elif c == 0:
    print(3)
elif d == 0:
    print(4)
elif e == 0:
    print(5)
import math

n = int(input())
a = [int(i) for i in input().split()]
m = []
if len(a) == 2:
    print(max(a))

else:
    for i in range(n-1):
        m.append(math.gcd(a[i],a[i+1]))
    m.append(math.gcd(a[0],a[i+1]))
    m = list(set(m))
    m.sort()
    print(m[1])


### FIXED CODE ###

from fractions import gcd

n = int(input())
a = [int(i) for i in input().split()]
l,r = [0],[0]
for i in range(1,n):
    l.append(gcd(l[i-1],a[i-1]))
    r.append(gcd(r[i-1],a[-i]))
r = r[::-1]
ans = 0

for i in range(n):
    ans = max(ans,gcd(l[i],r[i]))
print(ans)
import itertools

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

ijk=[x for x in range(n)]

ijkl=list(itertools.permutations(ijk,3))

a=[]
for ii in ijkl:
  if ii[0]<ii[1]<ii[2]:
    a.append(ii)

ans=0

for aa in a:
  list_=[]
  if l[aa[0]] != l[aa[1]] != l[aa[2]]:
    list_.append(l[aa[0]])
    list_.append(l[aa[1]])
    list_.append(l[aa[2]])

    max_=max(l[aa[0]],l[aa[1]],l[aa[2]])
    sum_=sum(list_)
    if max_ < (sum_-max_):
      ans+=1i

print(ans)

### FIXED CODE ###

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

ans=0
for i in range(n):
  for j in range(n):
    for k in range(n):
      if i <= j <= k:
        if l[i]==l[j] or  l[j]==l[k] or l[i]==l[k]:
          continue
        if max(l[i],l[j],l[k]) < l[i] +l[j] + l[k] - max(l[i],l[j],l[k]):
          ans+=1
print(ans)
import math
import sys

# print('input >>')
N = int(input())

if N % 2 == 1:
    print(0)
    sys.exit()

ans = 0
warusu = math.log(N, 5)
warusu = int(warusu)

for i in range(warusu):
    ans += (N // (5 ** (i+1))) // 2

# print('-----output-----')
print(ans)


### FIXED CODE ###

import math
import sys

# print('input >>')
N = int(input())

if N % 2 == 1 or N == 0:
    print(0)
    sys.exit()

ans = 0
warusu = math.log(N, 5)
warusu = int(warusu)

for i in range(warusu):
    ans += (N // (5 ** (i+1))) // 2

# print('-----output-----')
print(ans)
n = int(input())

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

a.sort(reverse=True)

print(a[::2] - a[1::2])

### FIXED CODE ###

n = int(input())

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

a.sort(reverse=True)

print(sum(a[::2]) - sum(a[1::2]))
import math
N,M = list(map(int,input().split()))

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

ans = combination(N,2) + combination(M,2)

print(ans)

### FIXED CODE ###

N,M = list(map(int,input().split()))
ans = (N*(N-1)//2) + (M*(M-1)//2)
print(ans)
a,b,c,d = map(int,input())
print(max(a*c,a*d,b*c,b*d))


### FIXED CODE ###

a,b,c,d = map(int,input().split())
print(max(a*c,a*d,b*c,b*d))
N,K=map(int,input().split())
N=list(map(int,input().split()))
a={}
 
b=1
a[1]=1
count=1
while(True):
  count+=1
  b=N[b-1]
  #print(b)
  if b in a:
    #print(a)
    #print(b)
    #print(count)
    cycle=count-a[b]
    rest=K-count+1
    ans=rest%cycle
    for i in range(ans-1):
      b=N[b-1]
    print(b)
    break
  a[b]=count
if count==K+1:
  print(b)
  break

### FIXED CODE ###

N,K=map(int,input().split())
A=list(map(int,input().split()))

count=0
k=1
countlist={}
#countlist[1]=A[0]
count=1
while True:    
    k=A[k-1]
    
    if k in countlist:
        cycle=count-countlist[k]
        rest=K-count
        move=rest%cycle
        for i in range(min(rest,move)):
            k=A[k-1]
        print(k)
        break
    
    countlist[k]=count
    
    if count==K:
        print(k)
        break
    
    count+=1
N=int(input())
a=list(map(int,input().split()))

MAX=max(a)
MIN=min(a)
m=0
operation=[]
if abs(MAX)>=abs(MIN):
    n=a.index(MAX)
    for i in range(N):
        a[i]+=MAX
        m+=1
        operation.append([n+1,i+1])
    for i in range(N-1):
        a[i+1]+=a[i]
        m+=1
        operation.append([i+1,i+2])
else:
    n=a.index(MIN)
    for i in range(N):
        a[i]+=MIN
        m+=1
        operation.append([n+1,i+1])
    for i in range(N,0,-1):
        a[i-1]+=a[i]
        m+=1
        operation.append([i+1,i])

print(m)
for i in range(m):
    print(*operation[i])

### FIXED CODE ###

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

MAX=max(a)
MIN=min(a)
m=0
operation=[]
if abs(MAX)>=abs(MIN):
    n=a.index(MAX)
    for i in range(N):
        a[i]+=MAX
        m+=1
        operation.append([n+1,i+1])
    for i in range(N-1):
        a[i+1]+=a[i]
        m+=1
        operation.append([i+1,i+2])
else:
    n=a.index(MIN)
    for i in range(N):
        a[i]+=MIN
        m+=1
        operation.append([n+1,i+1])
    for i in range(N-1,0,-1):
        a[i-1]+=a[i]
        m+=1
        operation.append([i+1,i])

print(m)
for i in range(m):
    print(*operation[i])
# なぜか途中からREなる...
n = int(input())
s = list(map(int, input().split()))
color = 0  # appeared_zero (0~2)
ans = 1
MOD = 1000000007
cur = [-1, -1, -1]
for c in s:
    if c == 0:
        cur[color] = 0
        color += 1
        ans *= 3 if color == 0 else 3 if color == 1 else 6
        ans %= MOD
    else:
        x = cur.count(c - 1)
        ans *= x
        ans %= MOD
        idx = cur.index(c - 1)
        cur[idx] += 1
ans *= 3 if color == 0 else 3 if color == 1 else 6
ans %= MOD
print(ans)


### FIXED CODE ###

# なんか雑に書いたらサンプル3通ったしこれでよさそう
# なんかしらんけど2ケースでWAなる
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7
ans = 1
d = [0] * (n + 10)
d[0] = 3
for i in range(n):
    ans *= d[a[i]]
    d[a[i]] -= 1
    d[a[i] + 1] += 1
    ans %= mod
print(ans)
n, x, t = map(int, input().split())
if n%x==0:
  print(n/x*t)
else:
  print(((int(n/x)+1)*t)


### FIXED CODE ###

n, x, t = map(int, input().split())
if n%x==0:
  print((n//x)*t)
else:
  print( ((n//x)+1)*t )
import math
from functools import lru_cache
@lru_cache(maxsize=None)
def p(n,r):
  return math.factorial(n)//math.factorial(n-r)
@lru_cache(maxsize=None)
def c(n,r):
  return p(n,r)//math.factorial(r)
n,a,b,k=map(int,input().split())
m=998244353
q=0
for i in range(0,n+1):
  j=k-i*a
  if j<0 or j%b:continue
  j//=b
  q=(q+c(n,i)*c(n,j))%m
print(q%m)

### FIXED CODE ###

n,a,b,k=map(int,input().split())
m=998244353
I=[0]*n
for i in range(n):
  I[i]=pow(i+1,m-2,m)
c=[0]*(n+1)
c[0]=1
for i in range(1,n+1):
  c[i]=(c[i-1]*(n-i+1)*I[i-1])%m
q=0
for i in range(n+1):
  j=(k-i*a)//b
  if (k-i*a)%b or j<0 or j>n:continue
  q=(q+c[i]*c[j])%m 
print(q%m)
x = int(input())
if x >= 30:
  print("Yes")
  else:
    print("No")


### FIXED CODE ###

x = int(input())
if x >= 30:
  print("Yes")
else:
    print("No")
i = int(input().replace(' ',''))
if i == (i ** 0.5) ** 2
    print("Yes")
else:
    print("No")


### FIXED CODE ###

a,b = map(int, input().split())
if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
import math as m

N=int(input())
X=int(input())
T=int(input())
s=N/X
s=m.ceil(s)
s=int(s)
i=s*T
print(i)

### FIXED CODE ###

import math as m

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

N=LIST[0]
X=LIST[1]
T=LIST[2]

s=N/X
s=m.ceil(s)
s=int(s)
i=s*T
print(i)
N = int(input())

s = []
k = 0
while N > 0:
	l = N % 26 //一番下のけた
	s.insert(0,chr(ord('a')+l-1))
	N = N // 26
	k +=1

print(s)
print(join(s))

### FIXED CODE ###

N = int(input())

s = []
k = 0
while N > 0:
	l = N % 26 #一番下のけた
	if l == 0:
		l = 26
	s.insert(0,chr(ord('a')+l-1))
	N = N-1
	N = N // 26
	k +=1


print(''.join(s))
bilding = [[[0 for i in range(10)] for j in range(3)]for k in range(4)]

n = int(input())
i = 0
while i < n:

### FIXED CODE ###

bilding = [[[0 for x in range(10)] for x in range(3)]for x in range(4)] 
n = int(input())
for k in range(n):
    b, f, r, v = map(int, raw_input().split())
    bilding[b-1][f-1][r-1] += v

for b in range(4):
    for f in range(3):
        print(" "+" ".join(map(str, bilding[b][f])))
    if b != 3:
        print("#"*20)
fun main(args:Array<String>) {
    val itemCount = readLine()!!.toInt()
    val items = (1..itemCount).map { readLine()!!.toInt() }.sortedDescending()
    val ans = items[0] / 2 + items.drop(1).sum()
    println(ans)
}

### FIXED CODE ###

# coding: utf-8

itemCount = int(input())

itemList = sorted([ int(input()) for i in range(itemCount)])
itemList.reverse()

ans = sum(itemList) - int(itemList[0] / 2)
print(ans)
N, M = map(int, input().split())
MOD = 10 ** 9 + 7
dp = [0 for _ in range(N)]
for _ in range(M):
    a = int(input())
    a -= 1
    dp[a] = -1
if dp[0] == 0:
    dp[0] = 1
if dp[1] == 0:
    if dp[0] == 1:
        dp[1] = 2
    else:
        dp[1] = 1

for i in range(2, N):
    if dp[i] != -1:
        if dp[i-1] != -1:
            dp[i] += dp[i-1]
        if dp[i-2] != -1:
            dp[i] += dp[i-2]
print(dp[N-1] % MOD)

### FIXED CODE ###

N, M = map(int, input().split())
MOD = 10 ** 9 + 7
dp = [0 for _ in range(N+1)]
for _ in range(M):
    a = int(input())
    dp[a] = -1
dp[0] = 1
if dp[1] == 0:
    dp[1] = 1

for i in range(2, N+1):
    if dp[i] != -1:
        if dp[i-1] != -1:
            dp[i] += dp[i-1]
        if dp[i-2] != -1:
            dp[i] += dp[i-2]

print(dp[N] % MOD)
import string
S=sorted(set((input())))
count = 0
for i in string.ascii_lowercase:
  if i!=S[count]:
    print(i)
    break
  count += 1
else:
  print('None')

### FIXED CODE ###

import string
word=sorted(set((input()))^set(string.ascii_lowercase))
print(word and word[0] or 'None')
def find(n):
    """
    tn = int(n/2)
    s = 2 * tn + 1
    :param n:
    :return:
    """
    tn = int(n/2)
    s = 2 * tn + 1
    count = 0
    line_list = []
    for i in range(1, n+1):
        for j in range(i+1, n+1):
            if i + j != s:
                line_list.append(f"{i} {j}")
                count +=1

    return count, line_list


if __name__ == '__main__':
    n = input()

    count, line_list = find(int(n))
    print(count)
    print("\n".join(line_list))

### FIXED CODE ###


def find(n):
    """
    tn = int(n/2)
    s = 2 * tn + 1
    :param n:
    :return:
    """
    tn = int(n / 2)
    s = 2 * tn + 1
    count = 0
    line_list = []
    for i in range(1, n + 1):
        for j in range(i + 1, n + 1):
            if i + j != s:
                line_list.append(str(i) + " " + str(j))
                count += 1

    return count, line_list


if __name__ == '__main__':
    n = int(input())

    count, line_list = find(n)
    print(count)
    for item in line_list:
        print(item)
a = [int(input()) for _ in range(5)]
ans = 0
for i in a:
    ans += i if i%10 == 0 else i+(10-i%10)
    mod = max(mod,i%10) if i%10 == 0 else max(mod,10-i%10)
print(ans-mod)

### FIXED CODE ###

A = input()
B = input()
C = input()
D = input()
E = input()
ABC = [A,B,C,D,E]
sort_abc = []
time = 0
m = 9
for abc in ABC:
    if m < int(abc[-1]) or abc[-1] == '0':
        sort_abc.insert(0,abc)
    else:
        m = int(abc[-1])
        sort_abc.append(abc)
sort_abc = list(map(int,sort_abc))
for i in range(5):
    abc = sort_abc[i]
    if i == 4:
        time += abc
    else:
        if abc%10 == 0:
            time += abc
        elif abc%10 != 0 and abc >= 10:
            time += abc + (10-abc%10)
        else:
            time += 10       
print(time)
import math

N = int(input())
A = [int(i) for i in input().split()]

gcd = A[0]

for i in range(1,len(A)):
    gcd = math.gcd(gcd,A[i])

print(gcd)

### FIXED CODE ###

import fractions

N = int(input())
A = [int(i) for i in input().split()]

gcd = A[0]

for i in range(1,len(A)):
    gcd = fractions.gcd(gcd,A[i])

print(gcd)
from math import gcd
N=int(input())
A=list(map(int,input().split()))
flg=1
for i in range(N):
    for j in range(i+1,N):
        if gcd(A[i],A[j])!=1:
            flg=0
print("YES" if flg else "NO")        
        

### FIXED CODE ###

import sys
 
 
def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    a.sort()
    for i in range(1, n):
        if a[i] == a[i-1]:
            print("NO")
            exit()
    print("YES")
 
 
if __name__ == '__main__':
    solve()
s = list(input())
print(reversed(s).index("Z")-s.index("A")+1)

### FIXED CODE ###

s = list(input())
print(len(s)-s[::-1].index("Z")-s.index("A"))
x1,y1,x2,y2=map(int,input().split())
print(x2-(y2-y1),y2-(x1-x2),x1-(y2-y1),y1-(x1-x2),end='')

### FIXED CODE ###

K=int(input())
print(int((K/2)**2) if K%2==0 else int(K/2)*(int(K/2)+1))
if sum(map(int,input().split()))<22:
 print("win")
else print("bust")


### FIXED CODE ###

print('bust'if sum(map(int,input().split()))>=22else 'win')
S = input()

if S = "ABC":
    print("ARC")
if S = "ARC":
    print("ABC")

### FIXED CODE ###

S = input()

if S == "ABC":
    print("ARC")
if S == "ARC":
    print("ABC")
s = input()

print(x*x)

### FIXED CODE ###

s = int(input())

print(s*s)
A,B,K = map(int,input().split())
S = []
for i in range(50):
    if A % (i + 1) == 0 and B % (i + 1) == 0:
        S.append(i + 1)
print(S[-K])

### FIXED CODE ###

A,B,K = map(int,input().split())
S = []
for i in range(100):
    if A % (i + 1) == 0 and B % (i + 1) == 0:
        S.append(i + 1)
print(S[-K])