Harryxun/stf_run huggingface dataset:
import collections

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

c = collections.Counter(ls)

ls_s = c.most_common()
ls_s.sort(reverse=True)

mul = []

for i in range(len(ls_s)):
    if ls_s[i][1] >= 4:
        if len(mul) == 0:
            print(ls_s[i][0] ** 2)
            break
        elif len(mul) == 1:
            print(ls_s[i][0] * mu;[0])
            break
    elif ls_s[i][1] >= 2:
        mul.append(ls_s[i][0])
    
    if len(mul) >= 2:
        print(mul[0] * mul[1])
        break
    elif i == len(ls_s) - 1:
        print(0)

### FIXED CODE ###

import collections

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

c = collections.Counter(ls)

ls_s = c.most_common()
ls_s.sort(reverse=True)

mul = []

for i in range(len(ls_s)):
    if ls_s[i][1] >= 4:
        if len(mul) == 0:
            print(ls_s[i][0] ** 2)
            break
        elif len(mul) == 1:
            print(ls_s[i][0] * mul[0])
            break
    elif ls_s[i][1] >= 2:
        mul.append(ls_s[i][0])
    
    if len(mul) >= 2:
        print(mul[0] * mul[1])
        break
    elif i == len(ls_s) - 1:
        print(0)
import math
a,b = map(str,input().split())
a = int(a)
b.remove(".")
# print(a,b)
b = int(b)
ans = (a*b)//100
print(ans)

### FIXED CODE ###

import math
a,b = map(str,input().split())
a = int(a)
b_ =str()
for i in b:
    if(i != "."):
        b_ = b_ +i
# print(b_)
b_ = int(b_)
ans = (a*b_)//100
print(ans)
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

a, b = [0],[0]
for i in range(n):
        a.append(a[i]+A[i])
for i in range(m):
        b.append(b[i]+B[i])

ans, j = 0, M

for i in range(N+i):
        if a[i] > K:
                break
        while b[j] > K - a[i]:
                j -= 1
        ans = max(ans, i+j)

print(ans)


### FIXED CODE ###

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

a, b = [0], [0]
for i in range(N):
        a.append(a[i]+A[i])
for i in range(M):
        b.append(b[i]+B[i])

ans, j = 0, M

for i in range(N+1):
        if a[i] > K:
                break
        while b[j] > K - a[i]:
                j -= 1
        ans = max(ans, i+j)

print(ans)
def change_fb(str_list):
    tmp = str_list[0]
    str_list[0] = str_list[-1]
    str_list[-1] = tmp

s = str(input())
q = int(input())
w = [input() for i in range(q)]

change = False
str_list = list(s)
for data in w:
    if int(data[0]) == 1:
        change = not change
    else:
        if change:
            change = False
            change_fb(str_list)
        t,f,c = data.split()
        if int(f) == 1:
            str_list.insert(0, c)
        else:
            str_list.append(c)
    print(str_list)

if change:
    change_fb(str_list)

print("".join(str_list))

### FIXED CODE ###

s = list(str(input()))
q = int(input())
w = [list(map(str,input().split())) for i in range(q)]

reverse = False
front_list = []
end_list = []

for data in w:
    if int(data[0]) == 1:
        reverse = not reverse
    else:
        if (int(data[1]) == 1 and not reverse) or (int(data[1]) == 2 and reverse):
            front_list.append(data[2])
        else:
            end_list.append(data[2])
if not reverse:
    front_list.reverse()
    print("".join(front_list + s + end_list))
else:
    end_list.reverse()
    s.reverse()
    print("".join(end_list + s + front_list))
N = int(input())
cnt = 0
L = []
for i in range(N):
	L.append(list(map(int, input().split())))

for i in range(N):
	A, B = L[-i+1]
	cnt += -(A + cnt)%B
print(cnt)

### FIXED CODE ###

N = int(input())
cnt = 0
L = []
for i in range(N):
	L.append(list(map(int, input().split())))

L = L[::-1]
 
for i in range(N):
	A, B = L[i]
	if A:
		cnt += -(A + cnt)%B

print(cnt)
k, x = map(int, input().split())
print(' '.join([x for x in range(x - k + 1, x + k)]))


### FIXED CODE ###

k, x = map(int, input().split())
print(' '.join([str(i) for i in range(x - k + 1, x + k)]))
# -*- coding: utf-8 -*-
import sys


def input():
    return sys.stdin.readline().strip()


def main(N, DATA):
    dp = [[0 for _ in range(N)] for _ in range(N + 1)]

    for i in range(N):
        for j in range(3):
            for k in range(3):
                if j == k:
                    continue

                # ここと      ここを比較  ↓比較対象はこれ、j+ k
                dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + DATA[i][k])

    res = 0

    for v in range(N):
        res = max(res, dp[N][v])
    print(res)


if __name__ == '__main__':
    N = int(input())
    DATA = [input().split() for _ in range(N)]
    # N = 3
    # DATA = [
    #     [10, 40, 70],
    #     [20, 50, 80],
    #     [30, 60, 90]
    # ]
    main(N, DATA)


### FIXED CODE ###

import sys

input = sys.stdin.readline

vacation = int(input())
lst_happiness = [list(map(int, input().split())) for i in range(vacation)]

dp = [[0 for i in range(3)] for j in range(vacation+1)]
def chmax(a, b):
    if a > b:
        return a
    else:
        return b

for i in range(vacation):
    for j in range(3):
        for k in range(3):
            if j == k:
                continue
            dp[i+1][k] = chmax(dp[i+1][k], dp[i][j] + lst_happiness[i][k])
ans = 0
for i in range(3):
    ans = chmax(ans, dp[vacation][i])
print(ans)
import copy
N, K = map(int, input().split())
dic = {}
ans = []
uniq = []
etc = []
def calc_ans(ans):
    x = 0
    tmp = 0
    for i in range(K):
      tmp += ans[i][0]
      x += ans[i][1]
    tmp += x * x
    return tmp

for i in range(N):
    l = list(map(int, input().split()))
    if dic.get(l[0]):
        dic[l[0]].append(l[1])
    else:
        dic[l[0]] = [l[1]]
for t in dic.keys():
    dic[t].sort(reverse=True)
    uniq.append((dic[t][0], t))
uniq.sort(reverse=True)
for i in range(K):
  ans.append((uniq[i][0], 1))
  for n in dic[uniq[i][1]][1:]:
      if n <= uniq[K-1][0]:
          break
      etc.append((n, 0))
etc.sort(reverse=True)
for n in etc:
    ans_res = calc_ans(ans)
    tmp = copy.copy(ans)
    tmp[-1] = n
    tmp_res = calc_ans(tmp)
    if ans_res > tmp_res:
        print(ans_res)
        exit()
    else:
        ans = copy.copy(tmp)
print(tmp_res)


### FIXED CODE ###

N,K = map(int,input().split())
td = [[int(i) for i in input().split()] for _ in range(N)]
td.sort(key=lambda x:x[1],reverse=True)
ans = 0
ls = set()
dl = []
for i in range(K):
    ans += td[i][1]
    if not td[i][0] in ls:
        ls.add(td[i][0])
    else:
        dl.append(td[i][1])
ans = ans + len(ls)**2
res = ans
for i in range(K,N):
    if not dl:
        break
    if td[i][0] in ls:
        continue
    ans += len(ls)*2+1
    ans += td[i][1]
    ans -= dl[-1]
    del dl[-1]
    res = max(res,ans)
    ls.add(td[i][0])
print(res)
import sys
import numpy as np
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
sys.setrecursionlimit(10**7)

n, m, l = [int(i) for i in sys.stdin.readline().split()]
graph = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    a, b, c = [int(i) for i in sys.stdin.readline().split()]
    a -= 1
    b -= 1
    graph[a][b] = c
    graph[b][a] = c

res = floyd_warshall(csgraph_from_dense(graph))
res = np.where(res <= l, np.ones_like(res), np.zeros_like(res))

new_res = floyd_warshall(csgraph_from_dense(res))
q = int(input())
for i in range(q):
    s, t = [int(i) for i in sys.stdin.readline().split()]
    s -= 1
    t -= 1
    dis = new_res[s][t] if not np.isinf(new_res[s][t]) else 0
    print(int(dis) - 1)

### FIXED CODE ###

import sys
import numpy as np
from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall, csgraph_to_dense
from scipy.sparse import issparse
sys.setrecursionlimit(10**7)

n, m, l = [int(i) for i in sys.stdin.readline().split()]
graph = [[0 for i in range(n)] for j in range(n)]
for i in range(m):
    a, b, c = [int(i) for i in sys.stdin.readline().split()]
    a -= 1
    b -= 1
    graph[a][b] = c
    graph[b][a] = c

res = floyd_warshall(csgraph_from_dense(graph))
if issparse(res):
    res = csgraph_to_dense(res)
res = np.where(res <= l, 1, 0)
new_res = floyd_warshall(res)
new_res[new_res == np.inf] = 0
q = int(input())
for j in range(q):
    s, t = [int(i) for i in sys.stdin.readline().split()]
    s -= 1
    t -= 1
    dis = new_res[s, t]
    print(int(dis) - 1)
= int(input())
l = [i for i in range(1, n+1)]
nl = []
    
for a in l:
     if a%15 != 0 or a%5 != 0 or a%3 != 0:
     	nl.append(a)
print(sum(nl))
  

### FIXED CODE ###

n = int(input())
l = [i for i in range(1, n + 1)]
nl = []

for a in l:
    if (a % 5 != 0) and (a % 3 != 0):
        nl.append(a)

print(sum(nl))
import bisect

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

T=int(input())
B=[int(i) for i in input().split()]

l=0
r=len(B)
c=(r+l)/2

n=0


for i in B:
    if i in A:
        n+=1
    elif A[i-1]>c:
        l=c
        c=(r+l)/2
    elif A[i-1]<c:
        r=c
        c=(r+l)/2

print(n)



### FIXED CODE ###


def bs(A, n):
    l=0
    r=len(A)
    while l<r:
        mid=int((l+r)/2)
        if A[mid]==n:
            return mid
        else:
            if n<A[mid]:
                r=mid
            else:
                l=mid+1

    return -1

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

T=int(input())
B=[int(j) for j in input().split()]

A.sort()

cnt=0
for i in range(T):
    x=bs(A,B[i])
    if x!=(-1):
        cnt=cnt+1

print(cnt)
N, M = map(int, input().split())
A = [[] for i in range(0, N)]
for i in range(0, M):
    x, y = map(int, input().split())
    if y in A[x-1]:
        continue
    A[x-1].append(y)
for a in A:
    if len(a) > 1:
        print(-1)
        exit(0)
ans = ''
if A[0][0] == 0:
    print(-1)
    exit(0)
for i in range(0, N):
    if len(A[i]) == 1:
        ans += str(A[i][0])
    else:
        ans += '0'
print(ans)


### FIXED CODE ###

N, M = map(int, input().split())
A = []
for i in range(0, M):
    a = tuple(map(int, input().split()))
    A.append(a)
start = 10**(N-1)
if N == 1:
    start = 0
for x in range(start, 10**N):
    ans = str(x)
    flag = True
    for a in A:
        if ans[a[0]-1] != str(a[1]):
            flag = False
    if flag:
        print(x)
        exit(0)
print(-1)
from collections import Counter
n = int(input())
arr = list(map(int, input().split()))

odd_list =[]
num_list =[]

for i in range(n):
    if i%2 == 0:
        odd_list.append(arr[i])
    if i%2 != 0:
        num_list.append(arr[i])

odd_count = Counter(odd_list)
num_count = Counter(num_list)
odd1 = odd_count[odd_count.most_common()[0][0]]
num1 = num_count[num_count.most_common()[0][0]]

if odd1 != num1:
    print(n-odd_count.most_common()[0][1]-num_count.most_common()[0][1])
    exit()

if odd1 == odd2:
    odd2 = odd_count[odd_count.most_common()[1][0]]
    num2 = num_count[num_count.most_common()[1][0]]


### FIXED CODE ###

from collections import Counter
n = int(input())
arr = list(map(int, input().split()))

odd_list =[]
num_list =[]

for i in range(n):
    if i%2 == 0:
        odd_list.append(arr[i])
    if i%2 != 0:
        num_list.append(arr[i])

odd_count = Counter(odd_list)
num_count = Counter(num_list)
odd1 = odd_count[odd_count.most_common()[0][0]]
num1 = num_count[num_count.most_common()[0][0]]

if odd1 != num1:
    print(n-odd_count.most_common()[0][1]-num_count.most_common()[0][1])
    exit()

if len(set(arr)) == 1:
    print(int(n/2))
    exit()

if len(set(num_list))==1 and len(set(odd_list))==1:
    print(0)
    exit()

if len(set(odd_count)) == 1 and len(set(num_count)) != 1:
    num2 = num_count[num_count.most_common()[1][0]]
    if odd_list[0] == num_count.most_common()[0][0]:
        print(int(n/2)-num2)
        exit()
    if odd_list[0] != num_count.most_common()[0][0]:
        print(int(n/2)-num1)
        exit()

if len(set(odd_count)) != 1 and len(set(num_count)) == 1:
    odd2 = odd_list[odd_count.most_common()[1][0]]
    if num_list[0] == odd_count.most_common()[0][0]:
        print(int(n/2)-odd2)
        exit()
    if num_list[0] != odd_count.most_common()[0][0]:
        print(int(n/2)-odd1)
        exit()

odd2 = odd_count[odd_count.most_common()[1][0]]
num2 = num_count[num_count.most_common()[1][0]]

if odd_count.most_common()[0][0] != num_count.most_common()[0][0]:
    print(n-odd1-num1)

if odd_count.most_common()[0][0] == num_count.most_common()[0][0]:
    print(min(n-odd1-num2, n-odd2-num1))
import sys, math, collections, heapq, itertools
from bisect import bisect_left
  
def solve():
    file = sys.stdin.readline #single: int(file()), line: map(int, file().split())
    INF = 10 ** 25
    mod = 7 + 10 ** 9
    N = int(file())
    A = [int(a) for a in file().split()]
    A.sort()
    ans = 0
    out = []
    if N == 2:
        ans = A[1] - A[0]
        out = [A[1], A[0]]
    else:
        plus = bisect_left(A, 0)
        if plus == 0:
            ans = A[0]
            for i in range(1, N-1):
                out.append([ans, A[i]])
                ans -= A[i]
            out.append([A[N-1], ans])
            ans = A[N-1] - ans
        elif plus < N:
            ans = A[0]
            for i in range(plus, N - 1):
                out.append([ans, A[i]])
                ans -= A[i]
            out.append([A[N-1], ans])
            ans = A[N-1] - ans
            for i in range(1, plus):
                out.append([ans, A[i]])
                ans -= A[i]
        else:
            ans = A[N-1]
            for i in range(N-1):
                out.append([ans, A[i]])
                ans -= A[i]

    print(ans)
    for k in out:
        print(" ".join(map(str, k)))


    return 0
  
if __name__ == "__main__":
    solve()

### FIXED CODE ###

import sys, math, collections, heapq, itertools
from bisect import bisect_left
  
def solve():
    file = sys.stdin.readline #single: int(file()), line: map(int, file().split())
    INF = 10 ** 25
    mod = 7 + 10 ** 9
    N = int(file())
    A = [int(a) for a in file().split()]
    A.sort()
    ans = 0
    out = []
    if N == 2:
        ans = A[1] - A[0]
        out = [[A[1], A[0]]]
    else:
        plus = bisect_left(A, 0)
        if plus == 0:
            ans = A[0]
            for i in range(1, N-1):
                out.append([ans, A[i]])
                ans -= A[i]
            out.append([A[N-1], ans])
            ans = A[N-1] - ans
        elif plus < N:
            ans = A[0]
            for i in range(plus, N - 1):
                out.append([ans, A[i]])
                ans -= A[i]
            out.append([A[N-1], ans])
            ans = A[N-1] - ans
            for i in range(1, plus):
                out.append([ans, A[i]])
                ans -= A[i]
        else:
            ans = A[N-1]
            for i in range(N-1):
                out.append([ans, A[i]])
                ans -= A[i]

    print(ans)
    for k in out:
        print(" ".join(map(str, k)))


    return 0
  
if __name__ == "__main__":
    solve()
# coding:utf-8

line = input()
ls = line.split(" ")
n = ls[0]
a = ls[1]
b = ls[2]

print(b) if n * a >= b else print(n * a)

### FIXED CODE ###

# coding:utf-8

line = input()
ls = line.split(" ")
n = int(ls[0])
a = int(ls[1])
b = int(ls[2])

print(b) if n * a >= b else print(n * a)
n = int(input())
a = [input().split() for l in range(n)]
b = 0
t = [0]
x = [0]
y = [0]
for i in range(n):
    t.append(a[i][0])
    x.append(a[i][1])
    y.append(a[i][2])

for k in range(n+1):
    o = int(t[k+1])-int(t[k])
    p = int(x[k+1])-int(x[k])
    q = int(y[k+1])-int(y[k])
    if (o >= p+q) and ((o - (p+q))%2 == 0):
        b += 1
    else:
        b = b

if b == n:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n = int(input())
a = [input().split() for l in range(n)]
b = 0
t = [0]
x = [0]
y = [0]
for i in range(n):
    t.append(a[i][0])
    x.append(a[i][1])
    y.append(a[i][2])

for k in range(n):
    o = int(t[k+1])-int(t[k])
    p = int(x[k+1])-int(x[k])
    q = int(y[k+1])-int(y[k])
    if (o >= p+q) and ((o - (p+q))%2 == 0):
        b += 1
    else:
        b = b

if b == n:
    print('Yes')
else:
    print('No')
x = int(input())
print(a*x*x)

### FIXED CODE ###

x = int(input())
print(3*x*x)
# coding: utf-8

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

alice_time = range(a, b+1)
bob_time = range(c, d+1)
pushed_time = set(alice_time) & set(bob_time)

print(alice_time)
print(bob_time)

if not pushed_time:
	print (pushed_time[0] - pushed_time[-1])

### FIXED CODE ###

# coding: utf-8

a, b, c, d = map(int, input().split())
alice_time = [x for x in range(a, b+1)]
bob_time = [x for x in range(c, d+1)]
pushed_time = set(alice_time) & set(bob_time)

if len(pushed_time) == 0:
  print(0)
else:
  print(len(pushed_time) - 1)
for i in range(1,10): 
  for j in range(1,10): print "%dx%d=%d"%(i,j,i*j)

### FIXED CODE ###

for i in range(1,10): 
  for j in range(1,10): print "%dx%d=%d"%(i,j,i*j)
din = map(int, raw_input().split())
if (din[0]*din[1]) % 2 == 0:
  print("Even")
else:
  print("Odd")
  

### FIXED CODE ###

din = list(map(int,input().split()))
if (din[0]*din[1]) % 2 == 0:
  print("Even")
else:
  print("Odd")
import numpy as np

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

ks_list = []
for i in range(M):
    ks = list(map(int, input().split()))
    ks_list.append(ks)
    
p = list(map(int, input().split()))
ans = 0

for x in range(2 ** N + 1):
#     print("===========", x, ans)
    for m in range(M):
        c = 0
        for k in range(1, ks_list[m][0]+1):
            ks_mk = -ks_list[m][k]
            if int(format(x,'b').zfill(10)[ks_mk]) == 1:
                c += 1
#             print(ks_list, ks_list[m][k], ks_mk, format(x,'b').zfill(10), format(x,'b').zfill(10)[ks_mk])
#         print(c, p[m])
        if c % 2 != p[m]:
#             print("break")
            break
        if m == M-1:
            ans += 1
#     print(ans, ks_list, c, p)

print(ans)

### FIXED CODE ###

a_, p_ = input().split()
a = int(a_)
p = int(p_)

print( ((a * 3) + p) // 2)
S = input()
print("TBD" if S[6]>=5 or S[5]>=1 else "Heisei")

### FIXED CODE ###

S = input()
print("TBD" if S[6]>="5" or S[5]>="1" else "Heisei")
C = input()

dic = {'a':1,'b':2,'c':3,'d':4,'e':5,'f':6,'g':7,'h':8,'i':9,'j':10,'k':11,'l':12,'m':13,'n':14,'o':15,'p':16,'q':17,'r':18,'s':19,'t':20,'u':21,'v':22,'w':23,'x':24,'y':25,'z':26}

keys = list(dic.keys())

for i in range(26):
    if keys[i]==C:
        print(keys[i+1])
        break


### FIXED CODE ###

C = input()

alp = 'abcdefghijklmnopqrstuvwxyz'

print(alp[alp.find(C)+1])
a,b,c = map(int,input().split())
if (a > 0 and b > 0) or (a > b and a > 0) or (b > a and b > 0):
    print("Positive")
elif (a-b) == 0 or (b-a) == 0:
    print("Zero")
elif (a < 0 and b < 0) or (a > b and a < 0) or (b > a and b < 0):
    print("Negative")
print()

### FIXED CODE ###

import sys
a,b = map(int,input().split())
c = 0
if (a+b) == 0:
    print("Zero")
    sys.exit()
elif a < 0 and b < 0:
    if  (a-b) % 2 == 1:
        print("Positive")
        sys.exit()
elif a < 0 and b >= 0:
    if a%2 == 0:
        print("Positive")
        sys.exit()
elif b < 0 and a >= 0:
    if b % 2 == 0:
        print("Positive")
        sys.exit()
if (a+b) > 0:
    print("Positive")
else:
    print("Negative")
import bisect as bi

if __name__ == '__main__':

	x,n = map(int,input().split())
	A = list(map(int,input().split()))
	B = [i for i in range(101)]
	
	#差分を求める
	C = list(set(B) - set(A))

	#二分探索自身の位置を調べる
	ind = bi.bisect_left(C,x)

	if ind == 0:
		print(C[0])
	elif ind == x - n:
		print(C[ind])
	elif x == C[ind]:
		print(0)
	else:
		tmp_l = abs(C[ind-1] - x)
		tmp_r = abs(C[ind] - x)
		if tmp_l > tmp_r:
			print(C[ind])
		else:
			print(C[ind-1])



### FIXED CODE ###

import bisect as bi

if __name__ == '__main__':

    x,n = map(int,input().split())
    A = list(map(int,input().split()))
    B = [i for i in range(102)]
    
    #差分を求める
    C = list(set(B) - set(A))

    #二分探索自身の位置を調べる
    ind = bi.bisect_left(C,x)

    if ind == 0:
        print(C[0])
    elif ind == x - n:
        print(C[ind])
    else:
        tmp_l = abs(C[ind-1] - x)
        tmp_r = abs(C[ind] - x)
        if tmp_l > tmp_r:
            print(C[ind])
        else:
            print(C[ind-1])
x = input().split("")
y = input().split("")
i = 0
for n in range(3):
	if x[n] == y[n]:
		i += 1

print(i)

### FIXED CODE ###

x = list(input())
y = list(input())
i = 0
for n in range(3):
	if x[n] == y[n]:
		i += 1

print(i)
= list(input())
B = list(map(int, A))
for i in range(2**3):
  ans = B[0]
  for j in range(3):
    if ((i>>j) & 1):
      ans += B[j+1]
    else:
      ans -= B[j+1]
  if ans == 7:
    for k in range(3):
      print(B[k], end = "")
      if ((i>>k) & 1):
        print("+", end = "")
      else:
        print("-", end = "")
    print(B[3], end = "")
    print("=7")
    break


### FIXED CODE ###

A = list(input())
B = list(map(int, A))
for i in range(2**3):
  ans = B[0]
  for j in range(3):
    if ((i>>j) & 1):
      ans += B[j+1]
    else:
      ans -= B[j+1]
  if ans == 7:
    for k in range(3):
      print(B[k], end = "")
      if ((i>>k) & 1):
        print("+", end = "")
      else:
        print("-", end = "")
    print(B[3], end = "")
    print("=7")
    break
c = inuput()
if c == 'a' or c == 'i' or c == 'u' or c == 'e' or c == 'o':
  print('vowel')
else:
  print("consonant"
  

### FIXED CODE ###

c = input()
if c == 'a' or c == 'i' or c == 'u' or c == 'e' or c == 'o':
  print('vowel')
else:
  print("consonant")
N=int(input())
data=[int(input()) for i in range(N)]
mae=N//2+N%2
count=0
print(N-[i for i in data if i>N//2+N%2][0]+[i for i in data if i<=N//2+N%2][0])


### FIXED CODE ###

N=int(input())
data=[int(input()) for i in range(N)]
count=0
dic={}
for i in data:

    if i-1 in dic:
        num=dic.pop(i-1)
        dic.update({i:num+1})
    else:
        dic.update({i:1})
print(N-max([dic[i] for i in dic]))
print(700 + input().count()*100)

### FIXED CODE ###

print(700 + input().count("o")*100)
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

### FIXED CODE ###

N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)
from math import factorial
def ncr(n,r):
  return (factorial(n) // factorial(r) // factorial(n - r))

n= int(input())
a = list(int(i) for i in input().split())
s = [0]
tp = 0
for i in a:
  tp += i
  s.append(tp)
s.sort()
ans = 0
for i in range(n):
  if s[i] == s[i+1]:
    ans += 1
print(ncr(ans,2))

### FIXED CODE ###

from math import factorial
import sys
input = sys.stdin.readline
def ncr(n):
 if n <= 1:
  return 0
 elif n == 2:
  return 1
 else:
  return  (factorial(n) // 2) // factorial(n - 2)

n= int(input())
a = list(int(i) for i in input().split())
s = [0]
for i in range(n):
  s.append(s[i]+a[i])
s = sorted(s,reverse =True)
ans = 0
tmp = 1
for i in range(len(s)-1):
  if s[i] == s[i+1]:
   tmp += 1
  else:
   ans += ncr(tmp)
   tmp = 1
ans += ncr(tmp)
print(ans)
def p(x):
 if 2 in[x,pow(2,x,x)]:
  for i in range(3,int(x**.5+1),2):
   if x%i==0:return 0
  else:return 1
def f():
 n,c=map(int,input().split())
 b=str(c)*(c>=0)
 for h in'9731':
  if n>1:
   for m in range(int(10**(n-1)),0,-1):
    if((int(h)+m-1)*2+(c>=0)*c)%3:
     t=h+str(m-1).zfill(n-1)
     a=int(t+b+t[::-1])
     if p(a):return a
  else:
   a=int(h+b+h)
   if p(a):return a
 return'9'*n+b+'9'*n
print(f())


### FIXED CODE ###

def p(x):
 for i in range(3,int(x**.5+1),2):
  if x%i==0:return 0
 return 1
def f():
 n,c=map(int,input().split())
 s='9'*n
 if c<0:return(11,s+s)[n>1]
 for h in'9731':
  if n-1:
   for m in range(int(10**~-n),0,-1):
    t=h+str(m-1).zfill(n-1)
    a=int(t+str(c)+t[::-1])
    if p(a):return a
  else:
   a=int(h+str(c)+h)
   if p(a):return a
 return s+str(c)+s
print(f())