Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

a=int(input())
b=[int(j) for j in input().split()]
c=True
d=0
while c==True:
  for i in b:
    if i%2!=0:
      c=False
    else :
      i=i//2
  if c==True:
    d+=1
    
print(d)

### FIXED CODE ###

a=int(input())
b=[int(j) for j in input().split()]
c=True
d=0
while c==True:
  for i in range(len(b)):
    if b[i]%2!=0:
      c=False
    else :
      b[i]=b[i]//2
  if c==True:
    d+=1
    
print(d)
### BUGGY CODE ###

I=9**9
h,a,*m=open(0)
h,w,k,a,b,f,g=map(int,(h+a).split())
d=[I]*h*w
a=~w+a*w+b
d[a]=1
q=[a]
for s in q:
 o,p,u=s//w,s%w,d[s]+1
 for y,x in(1,0),(-1,0),(0,1),(0,-1):
  for z in range(k):
   i,j=o+y*~z,p+x*~z;t=i*w+j
   if(h>i>-1<j<w)-1or'.'<m[i][j]or d[t]<u:break
   q+=t,;d[t]=u
print(d[~w+f*w+g]%I-1)

### FIXED CODE ###

I=9**9
h,a,*m=open(0)
h,w,k,a,b,f,g=map(int,(h+a).split())
d=[I]*h*w
a=~w+a*w+b
d[a]=1
q=[a]
for s in q:
 for y,x in(1,0),(-1,0),(0,1),(0,-1):
  for z in range(k):
   i,j=s//w+y*~z,s%w+x*~z;t=i*w+j
   if(h>i>-1<j<w)-1or'.'<m[i][j]or d[t]<=d[s]:break
   if d[t]==I:q+=t,;d[t]=d[s]+1
print(d[~w+f*w+g]%I-1)
### BUGGY CODE ###

import numpy as np
import math

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

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

# 1 <= N <= 10^5
# 2 <= M <= 10^9
# 1 <= A <= 10^9

dp = np.zeros(N+1, dtype=int)

dp[N] = 0

for i in reversed(range(N)):
    # N-1 -> 0
    total = 0
    for j in range(i, N):
        total = (total + A[j]) % M
        if total == 0:
            dp[i] = 1 + dp[j+1]
            break

# print(dp)
print(sum(dp))


### FIXED CODE ###

import numpy as np
import math

def nCr(n,r):
    f = math.factorial
    return f(n) / f(r) / f(n-r)

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

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

# 1 <= N <= 10^5
# 2 <= M <= 10^9
# 1 <= A <= 10^9

S = []
total = 0
S.append(0)
for i in range(N):
    total = (total + A[i]) % M
    S.append(total)

oS = sorted(S)

count = 0

# print(oS)

cur_val = 0
number = 0
for i in range(0, N+1):
    if oS[i] == cur_val:
        number += 1
    if oS[i] > cur_val or i == N:
        if number >= 2:
            count += int(number * (number - 1) / 2)
        # print(cur_val, number)
        number = 1
        cur_val = oS[i]

print(count)
### BUGGY CODE ###

S = input()
Q = int(input())

for i in range(Q):
  TFC = input().split()
  T = int(TFC[0])
  if T == 1:
    # turn over
    S = S[-1::-1]
  elif T == 2:
    F = int(TFC[1])
    C = TFC[2]
    if F == 1:
      S = C + S
      # put C before S
    elif F == 2:
      S = S + C
      # put C after S

print(S)

### FIXED CODE ###

S = input()
Q = int(input())
turnover = False
suffix = ""
prefix = ""

for i in range(Q):
  TFC = input().split()
  T = int(TFC[0])
  if T == 1:
    # turn over
    turnover = not turnover
  elif T == 2:
    F = int(TFC[1])
    C = TFC[2]
    if turnover:
      if F == 1:
        F = 2
      else:
        F = 1
    if F == 1:
      prefix = prefix + C
      # put C before S
    elif F == 2:
      suffix = suffix + C
      # put C after S
S = prefix[-1::-1]+S+suffix
if turnover:
  S = S[-1::-1]

print(S)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(100000)

def insert(k, node):
    if k < node:
        if tree[node]["left"] == -1:
            tree[node]["left"] = k
            tree[k] = {"parent": node, "left": -1, "right": -1}
            return
        else:
            insert(k, tree[node]["left"])
    else:
        if tree[node]["right"] == -1:
            tree[node]["right"] = k
            tree[k] = {"parent": node, "left": -1, "right": -1}
            return
        else:
            insert(k, tree[node]["right"])


def pre_order(n):
    global pre_text
    
    if n == -1:
        return
    pre_text += " {}".format(n)
    pre_order(tree[n]["left"])
    pre_order(tree[n]["right"])


def in_order(n):
    global in_text
    
    if n == -1:
        return

    in_order(tree[n]["left"])
    in_text += " {}".format(n)
    in_order(tree[n]["right"])   

M = int(input())
root = "nan"
while root == "nan":
    inp = [n for n in input().split()]
    if inp[0] == "print":
        print()
        print()
    else:
        root = int(inp[1])

tree = {root:{"parent": -1, "left": -1, "right": -1}}

for _ in range(M-1):
    inp = [n for n in input().split()]
    if inp[0] == "print":
        in_text = ""
        pre_text = ""
        in_order(root)
        pre_order(root)
        print(in_text[:])
        print(pre_text[:])
    else:
        insert(int(inp[1]), root)

### FIXED CODE ###

# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(100000)

def insert(k, node):
    if k < node:
        if tree[node]["left"] == None:
            tree[node]["left"] = k
            tree[k] = {"parent": node, "left": None, "right": None}
            return
        else:
            insert(k, tree[node]["left"])
    else:
        if tree[node]["right"] == None:
            tree[node]["right"] = k
            tree[k] = {"parent": node, "left": None, "right": None}
            return
        else:
            insert(k, tree[node]["right"])


def pre_order(n):
    result = []
    if n == None:
        return []
    result.append(str(n))
    result.extend(pre_order(tree[n]["left"]))
    result.extend(pre_order(tree[n]["right"]))
    
    return result


def in_order(n):
    result = []
    
    if n == None:
        return []

    result.extend(in_order(tree[n]["left"]))
    result.append(str(n))
    result.extend(in_order(tree[n]["right"]))
    
    return result


M = int(input())
root = "nan"
while root == "nan":
    inp = [n for n in input().split()]
    if inp[0] == "print":
        print()
        print()
    else:
        root = int(inp[1])

tree = {root:{"parent": None, "left": None, "right": None}}

for i, _ in enumerate(range(M-1)):
    inp = [n for n in input().split()]
    if inp[0] == "print":
        in_text = ""
        pre_text = ""
        print(" " + " ".join(in_order(root)))
        print(" " + " ".join(pre_order(root)))
    else:
        insert(int(inp[1]), root)
        #if i%1000 == 0:
        #    print("done {}/{}".format(i, M))
### BUGGY CODE ###

N, Q = map(int, input().split())
S = input()
lr = [None] * Q
for _ in range(Q):
    lr[_] = list(map(int, input().split()))
for _ in range(Q):
    ans = S.count("AC", lr[_][0] - 1, lr[_][1])
    print(ans)


### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
L = len(S)
ACnum = [0] * L
for i in range(1, L):
    ACnum[i] += ACnum[i - 1]
    if S[i - 1] == "A" and S[i] == "C":
        ACnum[i] += 1

lr = [None] * Q
for _ in range(Q):
    lr[_] = list(map(int, input().split()))

for i in range(Q):
    ans = ACnum[lr[i][1] - 1] - ACnum[lr[i][0] - 1]
    print(ans)
### BUGGY CODE ###

n,a,b = [int(i) for i in input().split()]
mod = 10**9+7

def mpow(a,n):
  if n == 0:
    return 1
  x = mpow(a,n//2)
  ans = x*x%mod
  if n%2==1:
    ans *= a
  return ans
  
def comb(n,k):
  ans = 1
  for i in range(k):
    ans = ans*(n-i)%mod
  for i in range(1,k+1):
    ans = ans*mpow(i,mod-2)%mod
  return ans

print((mpow(2,n)-1-comb(n,a)-comb(n,b))%mod)
# print(comb(n,a))

### FIXED CODE ###

import math
n,a,b = [int(i) for i in input().split()]
mod = 10**9+7
  
def comb(n,k):
  ans = 1
  for i in range(k):
    ans = ans*(n-i)%mod
  for i in range(1,k+1):
    ans = ans*pow(i,mod-2,mod)%mod
  return ans

print((pow(2,n,mod)-1-comb(n,a)-comb(n,b))%mod)
# print(comb(n,a))
### BUGGY CODE ###

from itertools import count
a,b,c=map(int,input().split())
f=False
for n in count(0):
    p=(c+60*n)//(a+b)
    if n and d==((a+b)*p-(c+60*n)) and e==((c+60*n)-((a+b)*p+a)):
        n=-1
        break
    if (a+b)*p<=c+60*n<=(a+b)*p+a:
        break
    else:
        d=(a+b)*p-(c+60*n)
        e=(c+60*n)-((a+b)*p+a)
if n>=0:
    print(c+60*n)
else:
    print(n)



### FIXED CODE ###

from itertools import count
a,b,c=map(int,input().split())
g=set()
for n in count(0):
    p=(c+60*n)//(a+b)
    if ((a+b)*p-(c+60*n),(c+60*n)-((a+b)*p+a)) in g:
        n=-1
        break
    if (a+b)*p<=c+60*n<=(a+b)*p+a:
        break
    else:
        d=(a+b)*p-(c+60*n)
        e=(c+60*n)-((a+b)*p+a)
        g.add((d,e))
if n>=0:
    print(c+60*n)
else:
    print(n)
### BUGGY CODE ###

import statistics
 
N = int(input())
X = list(map(int, input().split()))
 
for i in range(len(X)):
    print(statistics.median(X[:i]+X[i+1:]))

### FIXED CODE ###

N = int(input())
X = list(map(int, input().split()))
Y = X[:]
Y = sorted(Y)

med1 = Y[N // 2 - 1]
med2 = Y[N // 2]

for x in X:
    if x < med2:
        print(med2)
    else:
        print(med1)
### BUGGY CODE ###

S = input()
Q = int(input())
B = ""
C = ""
t = 1
for i in range(Q):
    A = input()
    if A=="1":
        t*=-1
    else:
        AL = list(A.split())
        if AL[1]=="1":
            if t==1:
                B +=AL[2]
            else:
                C +=AL[2]
        elif AL[1]=="2":
            if t==1:
                C +=AL[2]
            else:
                B +=AL[2]

if t==-1:
    print(C[::-1]+S[::-1]+B)
else:
    print(B[::-1]+S+C)

### FIXED CODE ###

S = input()
Q = int(input())
B = []
C = []
t = 1
for i in range(Q):
    A = input()
    if A=="1":
        t*=-1
    else:
        AL = list(A.split())
        if AL[1]=="1":
            if t==1:
                B.append(AL[2])
            else:
                C.append(AL[2])
        elif AL[1]=="2":
            if t==1:
                C.append(AL[2])
            else:
                B.append(AL[2])

B = ''.join(B)
C = ''.join(C)

if t==-1:
    print(C[::-1]+S[::-1]+B)
else:
    print(B[::-1]+S+C)
### BUGGY CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
for i in range(n):
    if i == 0:
        print(max(a[1:]))
    elif i == n-1:
        print(max(a[:n-1]))
    else:
        print(max(max(a[0:i]), max(a[i+1:])))

### FIXED CODE ###

n = int(input())
a = [int(input()) for i in range(n)]
sa = sorted(a)
maxi = sa.count(sa[-1])
ans = sa[-1]
max_index = a.index(sa[-1])
if maxi == 1:
    for i in range(n):
        if i == max_index:
            print(sa[-2])
        else:
            print(ans)
else:
    for i in range(n):
        print(ans)
### BUGGY CODE ###

n=int(input())

def f_count(j):
    count=0
    for x in range(1,j):
        for y in range(1,j):
            rt=(x+y)**2-4*(x**2+y**2+x*y-j)
            z=(-(x+y)+rt**0.5)/2

            if rt>=0 and (-(x+y)+rt**0.5)%2==0:
                if int(z)>=1:
                    count+=1

            
           
    return count
    
for i in range(1,n+1):
    print(f_count(i))
    
                    

### FIXED CODE ###

N=int(input())

#f(N)を入れるリスト。f(1)=ans_list[0], f(N)=ans_list[N-1]
ans_list=[0]*N

for x in range(1,100):
    for y in range(1,100):
        for z in range(1,100):
            s=x**2+y**2+z**2+x*y+y*z+z*x
            if s<=N:
                ans_list[s-1]+=1
            
   
for i in range(N):
   print(ans_list[i])
### BUGGY CODE ###

n, k = map(int, input().split())
m = n**2
mod = 10**9+7
dp = [[[0]*(m+1) for j in range(i+1)] for i in range(n+1)]
dp[0][0][0] = 1
for i in range(n):
  for j in range(i+1):
    for l in range(m+1):
      dp[i][j][l] %= mod
      if j and l+2*(j-1) <= m:
        dp[i+1][j-1][l+2*(j-1)] += dp[i][j][l]*j**2
      if l+2*j <= m:
        dp[i+1][j][l+2*j] += dp[i][j][l]*(2*j+1)
        if l+2*(j+1) <= m: 
          dp[i+1][j+1][l+2*(j+1)] += dp[i][j][l]
ans = dp[n][0][k]%mod
print(ans)

### FIXED CODE ###

n, k = map(int, input().split())
m = n**2
mod = 10**9+7
dp = [[[0]*(m+1) for j in range(i+1)] for i in range(n+1)]
dp[0][0][0] = 1
for i in range(n):
  for j in range(i+1):
    for l in range(m+1):
      dp[i][j][l] %= mod
      if j and l+2*(j-1) <= m:
        dp[i+1][j-1][l+2*(j-1)] += dp[i][j][l]*j**2
      if l+2*j <= m:
        dp[i+1][j][l+2*j] += dp[i][j][l]*(2*j+1)
        if l+2*(j+1) <= m: 
          dp[i+1][j+1][l+2*(j+1)] += dp[i][j][l]
ans = dp[n][0][k]%mod
print(ans)
### BUGGY CODE ###

def binary(l,c,low,index):
    fst = 0
    last = len(l)
    mid = int(last/2)
    if fst == 0 and last ==0:
        l.insert(0,c)
        for i in range(len(index)):
            if low[i] > c:
                index[i] += 1
        return
    while fst < last:
        mid = int((fst+last) / 2)
        if l[mid] == c:
            return
        elif last == mid:
            break
        elif fst == mid:
            break
        elif l[mid] >= c:
            last = mid
        elif l[mid] <= c:
            fst = mid
    if l[mid] < c:
        mid+=1
    l.insert(mid,c)
    for i in range(len(index)):
        if low[i] > c:
            index[i] += 1

q = int(input())
S = []
a = []
low = []
for i in range(q):
    a.append(list(map(int,input().split())))
    if a[i][0] == 3:
        low.append(a[i][1])

index = [0]*len(low)

for i in range(q):
    if a[i][0] == 0:
        binary(S,a[i][1],low,index)
        print(len(S))
    elif a[i][0] == 1:
        if a[i][1] in S:
            print(1)
        else:
            print(0)
    elif a[i][0] == 2:
        if a[i][1] in S:
            S.remove(a[i][1])
            for b in range(len(index)):
                if low[b] > a[i][1]:
                    index[b] -= 1
    else:
        if index[0] < len(S):
            for b in range(index[0],len(S)):
                if S[b] <= a[i][2]:
                    print(S[b])
                    if b == len(S)-1:
                        del low[0]
                        del index[0]
                else:
                    del low[0]
                    del index[0]
                    break
        else:
            del low[0]
            del index[0]


### FIXED CODE ###

from bisect import bisect_left, bisect_right, insort_left

q = int(input())
S = []
D = {}
a = []
c = 0
for i in range(q):
    a.append(list(map(int,input().split())))

for i in range(q):
    if a[i][0] == 0:
        if not a[i][1] in D:
            insort_left(S,a[i][1])
            D[a[i][1]] = 1
            c += 1
        else:
            if not D[a[i][1]] == 1:
                D[a[i][1]] = 1
                c += 1
        print(c)
    elif a[i][0] == 1:
        if a[i][1] in D:
            if D[a[i][1]] == 1:
                print(1)
            else:
                print(0)
        else:
            print(0)
    elif a[i][0] == 2:
        if a[i][1] in D:
            if D[a[i][1]] == 1:
                D[a[i][1]] = 0
                c -= 1
    else:
        L = bisect_left(S,a[i][1])
        R = bisect_right(S,a[i][2])
        for j in range(L,R):
            if D[S[j]] == 1:
                print(S[j])
### BUGGY CODE ###


"""
AtCoder Beginner Contest 147 D

https://atcoder.jp/contests/abc147/submissions/8876207
https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d


"""

MOD = 10**9+7
N = int(input())
A = list(map(int, input().split()))

# XORではビット毎に計算していくのが基本的な戦略
# 60乗までなので
bits = [0] * 60
for num in A:
    # A_i<2**60なので
    for i in range(60):
        # iビット目に1が立っていたらカウント
        if num & (1<<i):
            bits[i] += 1

"""
pは0からスタート
A_iについて、pビット目に1が立っていたら、i<jを満たすA_jのpビット目に0が立っている個数分2**pをプラスする
また、pビット目に0が立っていたら、i<jを満たすA_jのpビット目に1が立っている個数分2**pをプラスする
i,jのペアを見ていく時に、pビット目の1と0が何回出会うかを考えるとわかりやすいか
配列全体をみて、pビット目に1がa個ある場合、0はN-a個ある。これがΣΣのループで出会うので、
p桁目についてはa*(N-a)回2**pを答えに加えることになる
（a*(N-a)についてはあんまり腑に落ちてないが、例2とかで手を動かしてみるとそうなるので。）

これを全pに対して実施すると良い。
最後にmodを取ると値が大きすぎてあれなので、つどmodを取る
"""



ans = 0
for i, a in enumerate(bits):
    ans += a*(N-a) * 2**i
    ans %= MOD

print(ans)

### FIXED CODE ###


"""
AtCoder Beginner Contest 147 D

https://atcoder.jp/contests/abc147/submissions/8876207
https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d


"""

MOD = 10**9+7
N = int(input())
A = list(map(int, input().split()))

# XORではビット毎に計算していくのが基本的な戦略
# 60乗までなので
bits = [0] * 60
for num in A:
    # A_i<2**60なので
    for i in range(60):
        # iビット目に1が立っていたらカウント
        if num & (1<<i):
            bits[i] += 1

"""
pは0からスタート
A_iについて、pビット目に1が立っていたら、i<jを満たすA_jのpビット目に0が立っている個数分2**pをプラスする
また、pビット目に0が立っていたら、i<jを満たすA_jのpビット目に1が立っている個数分2**pをプラスする
i,jのペアを見ていく時に、pビット目の1と0が何回出会うかを考えるとわかりやすいか
配列全体をみて、pビット目に1がa個ある場合、0はN-a個ある。これがΣΣのループで出会うので、
p桁目についてはa*(N-a)回2**pを答えに加えることになる
（a*(N-a)についてはあんまり腑に落ちてないが、例2とかで手を動かしてみるとそうなるので。）

これを全pに対して実施すると良い。
最後にmodを取ると値が大きすぎてあれなので、つどmodを取る
"""



ans = 0
for i, a in enumerate(bits):
    ans += a*(N-a) * 2**i
    ans %= MOD

print(ans)
### BUGGY CODE ###

n = int(input())

# 約数の個数
def divisible_count(n):
    divisors = 0
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors += 1
            if i != n // i:
                divisors += 1
    return divisors

res = 0
for i in range(1, n):
    num = n - i
    res += divisible_count(num)

print(res)


### FIXED CODE ###

n = int(input())

def num_divisors_table(n):
    table = [0] * (n + 1)
    
    for i in range(1, n + 1):
        for j in range(i, n + 1, i):
            table[j] += 1
    
    return table

div = num_divisors_table(n)

res = 0
for c in range(1, n):
    num = n - c
    res += div[num]

print(res)
### BUGGY CODE ###

# AtCoder Beginner Contest 176
# C - Step

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

ans=0

for i in range (1,N):
    if Als[i]>=max(Als[0:i]):
        pass
    else :
        ans+= max(Als[0:i])-Als[i]
print(ans)

### FIXED CODE ###

# AtCoder Beginner Contest 176
# C - Step

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

ans=0

for i in range (1,N):
    if Als[i]>=Als[i-1]:
        pass
    else :
        step=abs(Als[i]-Als[i-1])
        ans+=step
        Als[i]+=step
print(ans)
### BUGGY CODE ###

(N,M) = map(int,input().split())
A = [0]*M
B = [0]*M
for i in range(M):
    (A[i], B[i]) = map(int,input().split())
    A[i] -= 1
    B[i] -= 1

parent = [-1]*N

def boss(n):
    while parent[n] >= 0:
        n = parent[n]
    return n

P = [1]*N
S = (N*(N-1))//2

ans = [0] * M
ans[M-1] = S

for i in range(M-1):
    j = M-1-i
    bA = boss(A[j])
    bB = boss(B[j])
    if bA != bB:
        parent[bB] = bA
        S -= P[bA]*P[bB]
        P[bA] = P[bA] + P[bB]
        P[bB] = 0
    ans[j-1] = S

for i in range(M):
    print(ans[i])

### FIXED CODE ###

(N,M) = map(int,input().split())
A = [0]*M
B = [0]*M
for i in range(M):
    (A[i], B[i]) = map(int,input().split())
    A[i] -= 1
    B[i] -= 1

parent = [-1]*N
depth = [0] * N

def boss(n):
    d = 0
    while parent[n] >= 0:
        n = parent[n]
        d += 1
    return n,d

P = [1]*N
S = (N*(N-1))//2

ans = [0] * M
ans[M-1] = S

#print(A)
#print(B)

for i in range(M-1):
#    print(parent)
    j = M-1-i
    bA, dA = boss(A[j])
    bB, dB = boss(B[j])
#    print(A[j],B[j],bA,bB)
    if bA != bB:
        if depth[bA] < depth[bB]:
            (bA, bB) = (bB, bA)
        parent[bB] = bA
        S -= P[bA]*P[bB]
        P[bA] = P[bA] + P[bB]
        P[bB] = 0
        depth[bA] = max(depth[bA],depth[bB]+1)
    ans[j-1] = S

for i in range(M):
    print(ans[i])
### BUGGY CODE ###

import numpy as np
h, w, d = map(int, input().split())
num = h * w
mass = np.array([[0, 0] for _ in range(num + 1)])
mp = np.zeros(num+1, dtype=int)
for i in range(h):
    for j, a in enumerate(list(map(int, input().split()))):
        mass[a] += [i, j]
for i in range(d+1, num+1):
    mp[i] = mp[i-d] + np.sum(abs(mass[i]-mass[i-d]))
q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    print(mp[r]-mp[l])


### FIXED CODE ###

import sys
input = sys.stdin.readline
h, w, d = map(int, input().split())
num = h * w
x = [0] * (num + 1)
y = [0] * (num + 1)
mp = [0] * (num + 1)
for i in range(h):
    for j, a in enumerate(map(int, input().split())):
        x[a], y[a] = [i+1, j+1]
for i in range(d+1, num+1):
    mp[i] = mp[i-d] + abs(x[i] - x[i-d]) + abs(y[i] - y[i-d])
q = int(input())
for _ in range(q):
    l, r = map(int, input().split())
    print(mp[r]-mp[l])
### BUGGY CODE ###

n = int(input())
ans = 1 + n
if n % 2 == 0:
    max = int(n / 2)
else:
    max = int((n - 1) / 2)

for i in range (1, max):
    if n % i == 0 and i + n / i < ans:
        ans = i + n / i

print(int(ans - 2))


### FIXED CODE ###

import math
n = int(input())
ans = 1 + n

max = math.ceil(n**0.5)

for i in range (2, max+1):
    if n % i == 0 and i + n / i < ans:
        ans = i + n / i

print(int(ans - 2))
### BUGGY CODE ###

import sys
import os
import math
import itertools
def factorize(n):
    b = 2
    fct = []
    fct.append(1)
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

N = int(input())
listN = factorize(N)
x = 0
y = 0
L = [True for i in range(N*N)]
mini = 10**12
if len(listN) == 1:
    x = N
    y = 1
else:
    for i in range(1,len(listN)):
        tmp = list(itertools.combinations(listN,i))
        tmp = list(set(tmp))
        for j in range(len(tmp)):
            x0,y0 = 1,1
            for k in range(len(tmp[j])):
                x0 *= tmp[j][k]
                if L[x0]:
                    L[x0] = False
                    y0 = N//x0
                    if mini > abs(x0+y0):
                        mini = abs(x0+y0)
                        x = x0
                        y = y0
print(x-1+y-1)


### FIXED CODE ###

import sys
import os

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

N = int(input())
listN = make_divisors(N)
mini = 10**12
if len(listN) == 1:
    x = N
    y = 1
else:
    for i in range(len(listN)):
        x = listN[i]
        y = N//x
        mini = min(x+y,mini)
print(x-1+y-1)
### BUGGY CODE ###

from sys import stdin,stdout,setrecursionlimit
from collections import Counter as C
setrecursionlimit(10**6)
M = 1000000007
input = stdin.readline
def write(n,sep="\n"):
	stdout.write(str(n))
	stdout.write(sep)
def gil():
	return list(map(int, input().split()))
	
n = int(input())
h = gil()

CM = 1e18
def rp(i, h, n, c, p):
    global CM
    if i >= n:
        ans =  c + abs(p - h[n-1])
        CM = min(ans, CM)
        return ans
    x = abs(p - h[i])
    if c+x >= CM:
        return 1e18
    return min(rp(i+1, h, n, c + x, h[i]),rp(i+2, h, n, c + x, h[i]))
    
ans = min(rp(1, h, len(h), 0, h[0]),rp(2, h, len(h), 0, h[0]))
print(ans)


### FIXED CODE ###

from sys import stdin,stdout,setrecursionlimit
from collections import Counter as C
setrecursionlimit(10**6)
M = 1000000007
input = stdin.readline
def write(n,sep="\n"):
	stdout.write(str(n))
	stdout.write(sep)
def gil():
	return list(map(int, input().split()))
	
n = int(input())
h = gil()
dp = [1e18]*(n+1)
dp[0] = 0
for i in range(n):
    for j in [i+1, i+2]:
        if j < n:
            dp[j] = min(dp[j], dp[i] + abs(h[i] - h[j]))
print(dp[n-1])
### BUGGY CODE ###

import sys
X,K,D= map(int,input().split())
temp = X
for t in range(K):
    # 絶対値の小さい方に移動
    if abs(temp - D) < abs(temp + D):
        temp = temp-D
    else:
        temp = temp+D

    # 移動幅より小さくなったとき
    if abs(temp) < D:
        if (K-t-1) % 2 == 0:
            print(abs(temp))
            sys.exit()
        else:
            if abs(temp - D) < abs(temp + D):
                temp = temp-D
                print(abs(temp))
                sys.exit()
            else:
                temp = temp+D
                print(abs(temp))
                sys.exit()

print(abs(temp))



### FIXED CODE ###

import sys
X,K,D= map(int,input().split())
temp = X

if abs(X) > K*D:
    print(abs(X)-K*D)
    sys.exit()
    
for t in range(K):
    # 絶対値の小さい方に移動
    if abs(temp - D) < abs(temp + D):
        temp = temp-D
    else:
        temp = temp+D

    # 移動幅より小さくなったとき
    if abs(temp) < D:
        if (K-t-1) % 2 == 0:
            print(abs(temp))
            sys.exit()
        else:
            if abs(temp - D) < abs(temp + D):
                temp = temp-D
                print(abs(temp))
                sys.exit()
            else:
                temp = temp+D
                print(abs(temp))
                sys.exit()

print(abs(temp))
### BUGGY CODE ###

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

newLi = sorted(t, reverse=True)
li = []
ans = 0

for i in range(N):
  k = [newLi.pop(0), newLi.pop(0), newLi.pop(-1)]
  ans += k[1]

print(ans)

### FIXED CODE ###

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

newLi = sorted(t, reverse=True)
ans = 0

for i in range(N):
  ans += newLi[i * 2 + 1]

print(ans)