Harryxun/stf_run huggingface dataset:
import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
min = 0
for k in li:
    min += (k-i) ** 2
i = 2
while i <= 100:
  s = 0
  for k in li:
    s += (k-i) ** 2
  if s < min:
    min = s
  i += 1
print(min)
    

### FIXED CODE ###

import sys
n = int(sys.stdin.readline())
li = list(map(int, sys.stdin.readline().split()))
min = 0
for k in li:
    min += (k-1) ** 2
i = 2
while i <= 100:
  s = 0
  for k in li:
    s += (k-i) ** 2
  if s < min:
    min = s
  i += 1
print(min)
a = input().split()
a = [int(i) for i in a]
a = sort(a)
print(a[0]+a[1])

### FIXED CODE ###

a = input().split()
a = [int(i) for i in a]
a = sorted(a)
print(a[0]+a[1])
# -*- coding: utf-8 -*-

import sys
#sys.setrecursionlimit(10**6)
sys.setrecursionlimit(10*6)

def search(values,hp,vp,item):
	if not (0<=hp<len(values)): return
	if not (0<=vp<len(values[hp])): return
	if item!=values[hp][vp]: return
	values[hp][vp]=True
#	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
#		search(values,hp+dh,vp+dv,item)
	search(values,hp-1,vp,item)
	search(values,hp+1,vp,item)
	search(values,hp,vp-1,item)
	search(values,hp,vp+1,item)

def solve(values):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(values)):
		for j in range(len(values[i])):
			if values[i][j] in valid_items:
				search(values,i,j,values[i][j])
				count+=1
	return count

def main():
	line, values = input().strip(), list()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		value = list()
		for _ in range(H):
#			value.append(list(x for x in input().strip()))
			value.append(list(input().strip()))
		print(solve(value))
#		values.append(value)
		line = input().strip()
	for value in values:
		print(solve(value))

if __name__=='__main__':
	main()

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys
sys.setrecursionlimit(10**6)

def search(field,hp,vp,item):
	if not (0<=hp<len(field)): return
	if not (0<=vp<len(field[hp])): return
	if item!=field[hp][vp]: return
	field[hp][vp]=True
	for dh,dv in [[0,1],[0,-1],[1,0],[-1,0]]:
		search(field,hp+dh,vp+dv,item)
#	search(field,hp-1,vp,item)
#	search(field,hp+1,vp,item)
#	search(field,hp,vp-1,item)
#	search(field,hp,vp+1,item)

def solve(field):
	count,valid_items=0,set(['@','#','*'])
	for i in range(len(field)):
		for j in range(len(field[i])):
			if field[i][j] in valid_items:
				search(field,i,j,field[i][j])
				count+=1
	return count

def main():
	line = input().strip()
	while line!='0 0':
		H,W = list(map(int,line.split(' ')))
		field = list()
		for _ in range(H):
			field.append(list(input().strip()))
		print(solve(field))
		line = input().strip()

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

for i in range(1,N+1):
    print(A.count(str(i)))


### FIXED CODE ###

N = int(input())
A = input().split()

import collections
c = collections.Counter(A)

for i in range(1,N+1):
    print(c[str(i)])
A = int(input())
B = int(input())

if A >= 1 and A <= 9 and B >= 1 and B <= 9:
  print(A*B)
else:
  print(-1)

### FIXED CODE ###

a, b = map(int, input().split())
if (1 <= a and a <= 9 and 1 <= b and b <= 9):
  print(a*b)
else:
  print(-1)
A=int(input())
B=int(input())

print(A*B)

### FIXED CODE ###


tmp=input().split(" ")
A=int(tmp[0])
B=int(tmp[1])

print(A*B)
a,*b,c=list(input().split())
print(a+str(len(b))+c)

### FIXED CODE ###

a,*b,c=input()
print(a+str(len(b))+c)
l,r=map(int,input().split())
a=[]

if r-l > 3000:
    print(0)
else:
    for i in range(l,r+1):
        for j in range(i+1,r+1):
            a.append((i*j)%2019)

print(min(a))

### FIXED CODE ###

l,r=map(int,input().split())
a=[]

if r-l > 3000:
    print(0)
else:
    for i in range(l,r+1):
        for j in range(i+1,r+1):
            a.append((i*j)%2019)
    print(min(a))
from collections import deque


def Fibonacci(n): 
    if n<0: 
        print("Incorrect input") 
    # First Fibonacci number is 0 
    elif n==1: 
        return 1
    # Second Fibonacci number is 1 
    elif n==2: 
        return 2
    else: 
        return Fibonacci(n-1)+Fibonacci(n-2) 
        

N, M = map(int, input().split())

A = deque()

for _ in range(M):
    A.append(int(input()))

pos = 0
diff = []

for a in A:
    d = (a - 1) - pos
    diff.append(d)
    pos = a + 1

# 最後の階段
diff.append(N - pos)

diff = list(filter(lambda x: False if x <= 0 else True, diff))

F = [Fibonacci(d) for d in diff]

_sum = 1
for f in F:
    _sum *= f

print(_sum)

### FIXED CODE ###

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

broken = [0 for _ in range(n+1)]
for i in range(m):
    a = int(input())
    broken[a] = True

    
mod = 1000000007
dp = [0 for _ in range(n+2)]

dp[n] = 1
for i in range(n-1, -1, -1):
    if(broken[i]):
        dp[i] = 0
        continue

    dp[i] = (dp[i+1] + dp[i+2]) % mod

print(dp[0])
import math
a = int(input())
b = int(input())
c = int(input())


 
ab = a+b
bc = b+c
ac = a+c
 
minimum = min(ab,bc,ac)
 
print(minimum)


### FIXED CODE ###

import math
a, b, c = map(int, input().split())


 
ab = a+b
bc = b+c
ac = a+c
 
minimum = min(ab,bc,ac)
 
print(minimum)
n = int(input())
half_n = int(n//2)
ans = []

for i in range(1, half_n):
    a = str(i)
    b = str(n-i)
    count_a = 0
    count_b = 0
    for ai in a:
        count_a += int(ai)
    for bi in b:
        count_b += int(bi)
    ans.append(count_a + count_b)

print(min(ans))

### FIXED CODE ###

n = int(input())
half_n = int(n//2)
ans = []

if n == 2:
    print(2)
    exit()
else:
    for i in range(1, half_n):
        a = str(i)
        b = str(n-i)
        count_a = 0
        count_b = 0
        for ai in a:
            count_a += int(ai)
        for bi in b:
            count_b += int(bi)
        ans.append(count_a + count_b)

print(min(ans))
n = int(input())
l =[]
for i in range(0,n):
  l.append(input())
print(len(set(l))
  

### FIXED CODE ###

n = int(input())
l =[]
for i in range(0,n):
  l.append(str(input()))
print(len(set(l)))
h1=input()
print(h1*h1*h1)

### FIXED CODE ###

x = int(input())
print(x*x*x)
s = int(input())

a = s % (10**9)
b = s - a * 10**9

print(' '.join([0,0,1,1000000000,b,a]))

### FIXED CODE ###

s = int(input())

y = s//10**9
x = s%10**9
if x == 0:
    result = [0,0,10**9,1,x,y]
else:
    result = [0,0,10**9,1,10**9-x,y+1]
print(*result)
n, k = map(int, input().split())
v = list(map(int, input().split()))

m = k // 2 + (k % 2)

a = [0] * (n+1)
d = [0] * (n+1)

a[0] = 0
d[n] = 0
for i in range(n):
    a[i+1] = a[i] + v[i]
    d[n-1-i] = d[n-i] + v[n-1-i]

w = []
for i in range(n):
    w.append([v[i], i])

w.sort()

ans = 0

sv = sum(v)

for i in range(m):
    p = k - i
    if p >= n:
        temp = sv
        for _ in range(i):
            if w[i][0] >= 0:
                break
            temp -= w[i][0]
        ans = max(temp, ans)
    else:
        for j in range(p+1):
            #print(j, n-p-j, a[j], d[n-p-j])
            temp = a[j] + d[n-p+j]
            c = 0
            for _ in range(i):
                if w[c][0] >= 0:
                    break
                if w[c][1] < j or w[c][1] > n-p+j:
                    temp -= w[c][0]
                c += 1
                if c >= n:
                    break
            ans = max(temp, ans)

print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
v = list(map(int, input().split()))

m = k // 2 + (k % 2)

a = [0] * (n+1)
d = [0] * (n+1)

a[0] = 0
d[0] = 0
for i in range(n):
    a[i+1] = a[i] + v[i]
    d[i+1] = d[i] + v[n-1-i]

w = []
for i in range(n):
    w.append([v[i], i])

w.sort()

ans = 0

p = min(n, k)
for L in range(p + 1):
    for R in range(p + 1 - L):
        #print(L, R)
        temp = a[L] + d[R]
        b = min(L + R, k - L - R)
        c = 0
        while b > 0:
            if w[c][0] >= 0:
                break
            if w[c][1] < L or w[c][1] > n - 1 - R:
                #print(w[c][1], L, R)
                temp -= w[c][0]
                b -= 1
            c += 1
        #print(L, R, temp, b)
        ans = max(ans, temp)

print(ans)
S = input()
nQ = int(input())

Ques = []
nReverse = 0
nAddFront= 0
nAddBack = 0
for i in range(nQ):
  line = input().split()
  if int(line[0]) == 1:
    nReverse += 1
    Ques.append([int(line[0])])
  else:
    if int(line[1]) == 1:
      if nReverse % 2 == 0:
        nAddFront += 1
      else:
        nAddBack  += 1
    else:
      if nReverse % 2 == 0:
        nAddBack += 1
      else:
        nAddFront  += 1      
    Ques.append([int(line[0]),int(line[1]),line[2]])

#print(nAddFront,nAddBack)
SS = [-1] * (nAddFront + len(S) + nAddBack)
for i in range(len(S)):
   SS[nAddFront + i] = S[i]

left = nAddFront -1
right= nAddFront + len(S)

nReverseLoc = 0
for iQ in Ques:
   if iQ[0] == 1:
      nReverseLoc += 1
   if iQ[0] == 2:
    if int(iQ[1]) == 1:
      if nReverseLoc % 2 == 0:
        #nAddFront += 1
        SS[left] = iQ[2]
        left -= 1
      else:
        SS[right] = iQ[2]
        right += 1
    else:
      if nReverseLoc % 2 == 0:
        SS[right] = iQ[2]
        right += 1
      else:
        SS[left] = iQ[2]
        left  += 1 

S = "".join(SS)
if nReverse % 2 == 1:
  S = S[::-1]
  
print(S)

### FIXED CODE ###

S = input()
nQ = int(input())

Ques = []
nReverse = 0
nAddFront= 0
nAddBack = 0
for i in range(nQ):
  line = input().split()
  if int(line[0]) == 1:
    nReverse += 1
    Ques.append([int(line[0])])
  else:
    if int(line[1]) == 1:
      if nReverse % 2 == 0:
        nAddFront += 1
      else:
        nAddBack  += 1
    else:
      if nReverse % 2 == 0:
        nAddBack += 1
      else:
        nAddFront  += 1      
    Ques.append([int(line[0]),int(line[1]),line[2]])

#print(nAddFront,nAddBack)
SS = [-1] * (nAddFront + len(S) + nAddBack)
for i in range(len(S)):
   SS[nAddFront + i] = S[i]

left = nAddFront -1
right= nAddFront + len(S)

nReverseLoc = 0
for iQ in Ques:
   if iQ[0] == 1:
      nReverseLoc += 1
   if iQ[0] == 2:
    if int(iQ[1]) == 1:
      if nReverseLoc % 2 == 0:
        #nAddFront += 1
        SS[left] = iQ[2]
        left -= 1
      else:
        SS[right] = iQ[2]
        right += 1
    else:
      if nReverseLoc % 2 == 0:
        SS[right] = iQ[2]
        right += 1
      else:
        SS[left] = iQ[2]
        left  -= 1 

S = "".join(SS)
if nReverse % 2 == 1:
  S = S[::-1]
  
print(S)
# -*- coding: utf-8 -*-
a = int(input())
b = int(input())

if a==1 && b==2:
  c = 3
elif a==2 && b==1:
  c = 3
elif a==1 && b==3:
  c = 2
elif a==3 && b==1:
  c = 2
else:
  c = 1
  
print("{}".format(c))

### FIXED CODE ###

c = [1,2,3]

a = int(input())
b = int(input())

c.remove(a)
c.remove(b)

print(c[0])
n, a = map(int, input().split())
if int(n) < 500 :
  if a >= n :
    print("Yes")
  else :
    print("No")
  
elif n % 500 <= a :
  print("Yes")
else :
  print("No")

### FIXED CODE ###

n = int(input())
a = int(input())
if int(n) < 500 :
  if a >= n :
    print("Yes")
  else :
    print("No")
  
elif n % 500 <= a :
  print("Yes")
else :
  print("No")
def d_cake_123_sort_modified(X, Y, Z, K, A, B, C):
    # editionalの解法1
    ab = sorted([a + b for b in B for a in A], reverse=True)[:K]
    ans = sorted([e + c for e in ab for c in C], reverse=True)[:K]
    return ' '.join(map(str, ans))

X, Y, Z, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
print(d_cake_123_sort_all(X, Y, Z, K, A, B, C))

### FIXED CODE ###

def d_cake_123_sort_all(X, Y, Z, K, A, B, C):
    # editionalの解法2
    a, b, c = sorted(A, reverse=True), sorted(B, reverse=True), sorted(C, reverse=True)
    ans = []
    for i, a_i in enumerate(a, 1):
        for j, b_j in enumerate(b, 1):
            for k, c_k in enumerate(c, 1):
                if i * j * k <= K:
                    ans.append(a_i + b_j + c_k)
                else:
                    break
    ans.sort(reverse=True)
    return '\n'.join(map(str, ans[:K]))

X, Y, Z, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
B = [int(i) for i in input().split()]
C = [int(i) for i in input().split()]
print(d_cake_123_sort_all(X, Y, Z, K, A, B, C))
n,k = map(int,input().split())
a = [int(i) for i in input().split()]
hash = [0 for i in range(n+1)]
#dic = {a[i]:count}
if len(set(a))<=k:
  print(0)
  exit()
else:
  ans=0
  for i in a:
    hash[i]+=1
  L = list(set(hash))
  x = len(set(a)) - k
  for i in range(x+1):
    ans+=L[i]
  print(ans)


### FIXED CODE ###

n,k = map(int,input().split())
a = [int(i) for i in input().split()]
hash = [0 for i in range(n+1)]

if len(set(a))<=k:
  print(0)
  exit()
else:
  ans=0
  for i in a:
    hash[i]+=1
  hash.sort()
  L=hash
  #何種類減らすかカウントするx
  x = len(set(a)) - k
  j=0
  m=0
  while m!=x:
    if L[j]==0:
      j+=1
      continue
    else:
      ans+=L[j]
      j+=1
      m+=1
  print(ans)
d = ['','a','b','c','d','e','f','g','h','i','j']
N = int(input())
if N == 1:
  print("a")
elif N == 2:
  print("aa")
  print("ab")
else:
  ans = [[[]]for _ in range(N - 1)]
  ans[0][0] = [1]
  ans[1][0] = [1,1]
  ans[1].append([1,2])
  ansstr = []
  for i in range(N -2):
    for i2 in range(len(ans[i + 1])):
      for i3 in range(max(ans[i + 1][i2]) + 1):
        if i == N - 3:
          ansstr.clear()
          for i4 in range(N - 1):
            ansstr.append(d[ans[i + 1][i2][i4]])
          ansstr.append(d[i3 + 1])
          print("".join(ansstr))
        else:
          ans[i + 2].append(ans[i + 1][i2] + [i3 + 1])
    if i < N - 3:
      ans[i + 2].pop(0)
    

### FIXED CODE ###

d = ['','a','b','c','d','e','f','g','h','i','j']
N = int(input())
if N == 1:
  print("a")
elif N == 2:
  print("aa")
  print("ab")
else:
  ans = [[[]]for _ in range(N - 1)]
  ans[0][0] = [1]
  ans[1][0] = [1,1]
  ans[1].append([1,2])
  ansstr = []
  for i in range(N -2):
    for i2 in range(len(ans[i + 1])):
      for i3 in range(max(ans[i + 1][i2]) + 1):
        if i == N - 3:
          ansstr.clear()
          for i4 in range(N - 1):
            ansstr.append(d[ans[i + 1][i2][i4]])
          ansstr.append(d[i3 + 1])
          print("".join(ansstr))
        else:
          ans[i + 2].append(ans[i + 1][i2] + [i3 + 1])
    if i < N - 3:
      ans[i + 2].pop(0)
import itertools

N, M = map(int, input().split())
adj_matrix = [[0]*N for i in range(N)]

# 隣接行列を作る
for i in range(N):
  a, b = map(int, input().split())
  adj_matrix[a-1][b-1] = 1
  adj_matrix[b-1][a-1] = 1
  
cnt = 0

for each in itertools.permutations(range(N)):
  if each[0] != 0:  # 始点は1でないといけないから
    break
  factor = 1
  for i in range(N-1):
    factor *= adj_matrix[each[i]][each[i+1]]
  cnt += factor

print(cnt)

### FIXED CODE ###

import itertools

N, M = map(int, input().split())
adj_matrix = [[0]* N for _ in range(N)]

for i in range(M): #隣接行列
    a, b = map(int, input().split())
    adj_matrix[a-1][b-1] = 1
    adj_matrix[b-1][a-1] = 1

cnt = 0

for each in itertools.permutations(range(N)):
    if each[0] != 0:
        break
    factor = 1
    for i in range(N-1):
        factor *= adj_matrix[each[i]][each[i+1]]
    cnt += factor

print(cnt)
n,l=map(int, input().split()) #a1 a2 a3
s = [i for i in range(q)] 

s.sort()

print(''.join(s))

### FIXED CODE ###

n,l=map(int, input().split()) #a1 a2 a3

s = [input() for i in range(n)] 

s.sort()


print(''.join(s))
n = int(input())
numbers = list(map(int,input().split()))
p = numbers[0]
a, b = 0, 0
if p > 0:
    q = -1
    b = p + 1
elif p < 0:
    q = 1
    b = -p + 1
    
for i in range(1, n):
    if p > 0:
        p += numbers[i]
        if p >= 0:
            a += (p + 1)
            p -= (p + 1)
    else:
        p += numbers[i]
        if p <= 0:
            a -= (p - 1)
            p -= (p - 1)

for j in range(1, n):
    if q > 0:
        q += numbers[j]
        if q >= 0:
            b += (q + 1)
            q -= (q + 1)
    else:
        q += numbers[j]
        if q <= 0:
            b -= (q - 1)
            q -= (q - 1)


print(min(a, b))

### FIXED CODE ###

n = int(input())
numbers = list(map(int,input().split()))
p = numbers[0]
a, b = 0, 0
if p > 0:
    q = -1
    b = p + 1
elif p < 0:
    q = 1
    b = -p + 1
else:
    p, q = 1, -1
    a, b = 1, 1
    
for i in range(1, n):
    if p > 0:
        p += numbers[i]
        if p >= 0:
            a += (p + 1)
            p -= (p + 1)
    else:
        p += numbers[i]
        if p <= 0:
            a -= (p - 1)
            p -= (p - 1)

for j in range(1, n):
    if q > 0:
        q += numbers[j]
        if q >= 0:
            b += (q + 1)
            q -= (q + 1)
    else:
        q += numbers[j]
        if q <= 0:
            b -= (q - 1)
            q -= (q - 1)


print(min(a, b))
n ＝ int(input())
sum=0
for i in range(1,n+1):
    sum+=i
print(sum)


### FIXED CODE ###

n = int(input())
sum=0
for i in range(1,n+1):
    sum+=i
print(sum)
from itertools import permutations

inf = float("inf")
n,m,r = map(int,raw_input().split())
arr = map(int,raw_input().split())
x = range(n)
d = [[inf for i in x] for j in x]

for i in range(n):
	d[i][i] = 0

for i in x:
	f,t,c = map(int,raw_input().split())
	d[f-1][t-1] = c
	d[t-1][f-1] = c



for i in x:
	for j in x:
		for k in x:
			d[i][j] = min(d[i][j], d[i][k] + d[k][j])


ans = inf
for i in permutations(arr):
	distance = 0
	for j in range(r-1):
		distance += d[i[j]-1][i[j+1]-1]

	ans = min(ans,distance)

print ans

### FIXED CODE ###

from itertools import permutations
import sys

def main():
    
    N, M, R = map(int, sys.stdin.readline().split())
    r = [i - 1 for i in map(int, sys.stdin.readline().split())]
    
    d = [[float('inf')] * N for _ in range(N)]
    
    for i in range(N):
        d[i][i] = 0
        
    for i in range(M):
        a, b, c = map(int,sys.stdin.readline().split())
        d[a-1][b-1] = c
        d[b-1][a-1] = c
        
    for k in range(N):
        for i in range(N):
            for j in range(N):
                if d[i][j] > d[i][k] + d[k][j]:
                    d[i][j] = d[i][k] + d[k][j]
    
    ans = 10**12
    
    for each in permutations(r):
        t_dis = 0
        for i in range(R-1):
            t_dis += d[each[i]][each[i+1]]  
        
        ans = min(ans, t_dis)
    
    print(ans)

if __name__ == '__main__':
    main()
S=input()
  if S=='AAA':
    print('No')
  elif S=='BBB':
    print('No')
  else:
    print('Yes')

### FIXED CODE ###

s = input()
if s.count('B') == 3 or s.count('A') == 3:
  print("No")
else:
  print("Yes")
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split]
cost = []
for _ in range(N):
    c,t = [int(x) for x in input().split]
    if t <= T:
        cost.append(c)

if cost == True:
    print(min(cost))
else:
    print("TLE")

### FIXED CODE ###

#! /usr/bin/env python3
# -*- coding: utf-8 -*-
N,T = [int(x) for x in input().split()]
cost = []
for _ in range(N):
    c,t = [int(x) for x in input().split()]
    if t <= T:
        cost.append(c)

if cost:
    print(min(cost))
else:
    print("TLE")
c = a * b
d = c % 2
if d == 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

x = input().split()
a = x[0]
b = x[1]
c = int(a) * int(b)
d = c % 2
if d == 0:
  print('Even')
else:
  print('Odd')
from collections import defaultdict

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

d = defaultdict(int)

for x in arr:
    d[x] += 1

ans = []
for i in range(1, max(arr)):
    ans.append(d[i - 1] + d[i] + d[i + 1])

print(max(ans))

### FIXED CODE ###

from collections import Counter

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

for i in range(N):
    a.append(a[i]+1)
    a.append(a[i]-1)

ans = Counter(a)

print(ans.most_common()[0][1])
import math

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

now_max = 1

for i in range(round(math.pow(P, 1 / N)) + 1, 0, -1):
    if P % (i ** N) == 0:
        now_max = i
        break

print(now_max)

### FIXED CODE ###

N = str(input())

print(N.count('2'))
s=input()
k=int(input())
S=''
#for i in range(k):
#	S+=s
#print(s)
S = list(s)
#last_word=s[-1]
count=0
l_s=len(S)
code_list = 'abcdefghijklmnopqrstuvwxyz'
#print('step1')
if S[0]==S[1]:
  flag=True
for i in range(1,l_s):
  #print(S,count)
  if S[i]==S[i-1] and i<l_s-1:
    for j in code_list:
      if j != S[i+1] and j !=S[i-1]:
        S[i]=j
        count+=1
        break
  elif S[i]==S[i-1]:
    for j in code_list:
      if j != S[i-1] and j !=S[0]:
        S[i]=j
        count+=1
        break
if S[-1]==S[0] not flag:
  plu=k-1
else:
  plu= 0
print(count*k+plu)

### FIXED CODE ###

s=input()
k=int(input())
code_list = 'abcdefghijklmnopqrstuvwxyz'

def c1(s):#len(s)>1
  count1=0
  S = list(s)
  l_s=len(S)
  for i in range(1,l_s):
    #print(S,count)
    if S[i]==S[i-1] and i<l_s-1:
      for j in code_list:
        if j != S[i+1] and j !=S[i-1]:
          S[i]=j
          count1+=1
          break
    elif S[i]==S[i-1]:
      for j in code_list:
        if j != S[i-1] and j !=S[0]:
          S[i]=j
          count1+=1
          break
  return count1,S[-1]

def c2(s,last):#k>2 and len(s)>1
  S=list(s)
  count2=0
  l_s=len(S)
  for i in range(0,l_s):
    #print(S,count)
    if i==0:
      if S[0]==last:
        for j in code_list:
          if j != S[i+1] and j !=last:
            S[i]=j
            count2+=1
            break
    elif S[i]==S[i-1] and i<l_s-1:
      for j in code_list:
        if j != S[i+1] and j !=S[i-1]:
          S[i]=j
          count2+=1
          break
    elif S[i]==S[i-1]:
      for j in code_list:
        if j != S[i-1] and j !=S[0]:
          S[i]=j
          count2+=1
          break
  return count2,S[-1]

def c3(s,last):#k>1 len(s)>1
  S=list(s)
  count3=0
  l_s=len(S)
  for i in range(0,l_s):
    #print(S,count)
    if i==0:
      if S[0]==last:
        for j in code_list:
          if j != S[i+1] and j !=last:
            S[i]=j
            count3+=1
            break
    elif S[i]==S[i-1] and i<l_s-1:
      for j in code_list:
        if j != S[i+1] and j !=S[i-1]:
          S[i]=j
          count3+=1
          break
    elif S[i]==S[i-1]:
      for j in code_list:
        if j != S[i-1]:
          S[i]=j
          count3+=1
          break
  return count3

if len(s)==1:
  print(k//2)
elif k==1:
  c,_=c1(s)
  print(c)
elif k==2:
  count1,last=c1(s)
  count3=c3(s,last)
  print(count1+count3)
else:
  if k%2==0:
    count1,last=c1(s)
    count21,last21=c2(s,last)
    count22,last22=c2(s,last21)
    count3=c3(s,last22)
    #print(count1,count2,count3)
    print(count1+count21*((k-2)//2)+count22*((k-2)//2)+count3)
  else:
    count1,last=c1(s)
    count21,last21=c2(s,last)
    if k>3:
      count22,last22=c2(s,last21)
    else:
      count22=0
    count3=c3(s,last21)
    #print(count1,count21,count22,count3)
    print(count1+count21*((k-2)//2+1)+count22*((k-2)//2)+count3)
n = int(input())
p = [int(input()) for _ in range(n)]
print(p.sum() - p.max()//2)

### FIXED CODE ###

n = int(input())
p = [int(input()) for _ in range(n)]
print(sum(p) - max(p)//2)
a, b = map(int, input().split())
#print(a,b)
c = []
if b - a >= 2019:
    print(0)
else:
    for i in range(a,b):
        for j in range(i+1,b+1):
            c.append((i*j)%2019)
#print(c)
print(min(c))


### FIXED CODE ###

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

if b-a >= 2019:
    print(0)
else:
    c = []
    for i in range(a,b):
        for j in range(i+1,b+1):
            c.append(i*j % 2019)
    #print(c)
    print(min(c))
s = input()
a = []
for i in range(len(str(s))-2):
  a.append(abs(s[i]*100+s[i+1]*10+s[i+2]-753))
print(min(a))

### FIXED CODE ###

s = input()
a = []
for i in range(len(s)-2):
  a.append(abs(int(s[i])*100+int(s[i+1])*10+int(s[i+2])-753))
print(min(a))