Harryxun/stf_run huggingface dataset:
N = int(input()) 
height = list(map(int, input().split())) #入力：花の高さ
water_count = 0 #水やり回数
while True:
    index = [i for i, v in enumerate(height) if v >0] #水をやる必要のある花のリスト インデックスが連続した範囲でしか水やりできない
    
    if len(index) == len(height): #全部高さが一以上のとき
        height -= 1 
        water_count += 1
    
    else:
        # 花の水やり範囲を決定
        min_index = index[0] #インデックスの最小値
        max_index = index[0] #インデックスの最大値
    
        while True:
            if (max_index+1) in index:
                max_index += 1
            else:
                break
    
        for flower in range(min_index, max_index+1):
            height[flower] -= 1 
        water_count += 1 #水やりカウンタ増やす
        
    if sum(height) == 0: #水やりが終わったら終了
        break
print(water_count)

### FIXED CODE ###

def solve(height):
    
    water_count = 0 #水やり回数

    while True:
        index = [i for i, v in enumerate(height) if v >0] #水をやる必要のある花のリスト インデックスが連続した範囲でしか水やりできない
    
        # 花の水やり範囲を決定
        min_index = index[0] #インデックスの最小値
        max_index = index[0] #インデックスの最大値
    
        while True:
            if (max_index+1) in index:
                max_index += 1
            else:
                break
    
        for flower in range(min_index, max_index+1):
            height[flower] -= 1 
        water_count += 1 #水やりカウンタ増やす
        
        if sum(height) == 0: #水やりが終わったら終了
            break
    print(water_count)
    
def solve_zero(height): #元々のリストがすべて０のとき
    print(0)

if __name__ == "__main__":
    N = int(input()) 
    height = list(map(int, input().split())) #入力：花の高さ
    if sum(height) == 0:
        solve_zero(height)
    else:
        solve(height)
import copy
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

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

ans = 0
for i in range(N):
    tmp = copy.copy(A)
    tmp.pop(i)
    ans = max(ans, gcd(*tmp))

print(ans)

### FIXED CODE ###

def gcd(x, y):
    while y != 0:
        x, y = y, x%y
    return x

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

L = [0]*(N+1)
R = [0]*(N+1)
for i in range(1, N+1):
    L[i] = gcd(L[i-1], A[i-1])
    R[N-i] = gcd(R[N-i+1], A[N-i])

ans = 0
for i in range(N):
    ans = max(ans, gcd(L[i],R[i+1]))

print(ans)
#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

min_index = time_residual.index(min(time_residual_notZero))
# print(min_index)

ans = sum([-(-i//10)*10 for i in time]) + time_residual[min_index] - 10
print(ans)

### FIXED CODE ###

#2019/10/04
time = list(map(int, open(0).read().split()))
# print(time)

time_residual = [i%10 for i in time]
# print(time_residual)

time_residual_notZero = [i for i in time_residual if i%10 != 0 ]
# print(time_residual_notZero)

if(time_residual_notZero != []):
    ans = sum([-(-i//10)*10 for i in time]) + min(time_residual_notZero) - 10
else:
    ans = sum(time)
print(ans)
s = input()

i = 0
j = len(s) - 1
ans = 0
while i != j:
    if s[i] != s[j]:
        if s[i] != "x" and s[j] != "x":
            print(-1)
            exit()
        elif s[i] != "x":
            j -= 1
        else:
            i += 1
        ans += 1
    else:
        i += 1
        j -= 1

print(ans)

### FIXED CODE ###

s = input()

i = 0
j = len(s) - 1
ans = 0
while i != j:
    if abs(i - j) == 1:
        if s[i] == s[j]:
            break
    if s[i] != s[j]:
        if s[i] != "x" and s[j] != "x":
            print(-1)
            exit()
        elif s[i] != "x":
            j -= 1
        else:
            i += 1
        ans += 1
    else:
        i += 1
        j -= 1

print(ans)
import fractions
m,n=map(int,input().split())
print(m*n//gcd.fractions(m,n))

### FIXED CODE ###

import fractions
 
A,B = map(int,input().split())
gcd = fractions.gcd(A,B)
lcm = int(A*B/gcd)
print(lcm)
n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = 0
a.sort()
b.sort()
if a[len(a)-1] < b[0]:
 for i in range(a[len(a),b]):
  if i > x and i <= y:
   c = 1
   break
if c == 1:
 print("No war")
else:
 print("War")


### FIXED CODE ###

n,m,x,y = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split())) 
set1 = set()
set2 = set()
c = 0
maxa = max(a)
minb = min(b)
if maxa < minb:
  for i in range(maxa+1,minb+1):
    set1.add(i)
if x < y:
  for i in range(x+1,y+1):
    set2.add(i)
set3 = set1 & set2
if len(set3) >= 1:
  print("No War")
else:
  print("War")
x, y, z = map(int, input().split())

def takahashi(A, B, K):
  if A <= K <= A + B:
    print(0, B - (K - A))
  elif K < A:
    print(A - K, B)
  else:
    print(0, 0)
    
takahashi(x, y, z)

### FIXED CODE ###

import math

X = int(input())

cnt = 0

# 素数判定関数 素数:True, 素数じゃない:False
def prime(x):
  for i in range(2, math.floor(math.sqrt(x)) + 1):
    if x % i == 0:
      return False
  return True
      

for j in range(1000000000):
  if prime(X) == True:
    print(X)
    break
  else:
    X += 1
n, a, b = map(int, input().split())
ans = 0
for i in range(1, n+1):
    if a <= sum(map(int, str(i))) <= b:
        ans += i
print(ans)

### FIXED CODE ###

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

if a+b>c+d:
    print('Left')
elif a+b<c+d:
    print('Right')
else:
    print('Balanced')
x, n = map(int, input().split())
p = list(map(int, input().split()))


# x, n = 10, 5
# p =  [4, 7, 10, 6, 5]
# ->9が解

# pに含まれない整数リストを、最小値-1最大値+1も含めて求める
p.sort()
pl = min(p)-1
pr = max(p)+1
npl = list(range(pl, pr))
np = list(set(npl) - set(p))
np.sort()

# np内で最もxに近い数値を算出する
mx = x
res = x
for k in np:
  t = abs(k - x)
  if t < mx:
    mx = t
    res = k

print(k)

### FIXED CODE ###

x, n = map(int, input().split())
p = list(map(int, input().split()))
if n == 0:
  print(x)
  exit()
  
# x, n = 10, 5
# p =  [4, 7, 10, 6, 5]
# ->9が解
# x, n = 6, 5
# p = [4, 7, 10, 6, 5]

# x, n = 1, 1
# # p = list(range(1, 101))
# p = [1]

# pに含まれない整数リストを、最小値-1最大値+1も含めて求める
pl = min(p)-1
pr = max(p)+2
npl = list(range(pl, pr))
np = list(set(npl) - set(p))
if len(np) == 0:
  print(x)
  exit()
np.sort()

# np内で最もxに近い数値を算出する
mx = x
res = np[0]
for k in np:
  t = abs(k - x)
  if t < mx:
    mx = t
    res = k
 
print(res)
n, m = [int(i) for i in input().split()]
table = [[int(i) for i in input().split()] for m in range(m)]

a = range(table[0][0],table[0][1]+1)
for i,t in enumerate(table[1:]):
    if i == 0:
    	b = range(t[0], t[1]+1)
    	ans = set(a) & set(b)
    else:
        b = range(t[0], t[1]+1)
        ans = ans & set(b)
print(len(ans))

### FIXED CODE ###

n,m=map(int,input().split())
low=1
high=n
for i in range(m):
	l,r=map(int,input().split())
	low = max(low,l)
	high=min(high,r)
ans=high-low+1
print(ans if ans>=0 else 0)
N, K = map(int, input().split())
import math
def nCr(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for j in range(K):
  if (2*j+1)>N:
    print(0)
  else:
    x = (nCr((K+j-2), j) * nCr(N-K+1, j+1)
    if x > 10**9+7:
         print(x-(10**9+7))
    else:
         print(x)
        

### FIXED CODE ###

N, K = map(int, input().split())
from operator import mul
from functools import reduce
 
def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under
 
for j in range(K):
  if (K+j)>N:
    print(0)
  else:
    x = (nCr((K-1), j) * nCr(N-K+1, j+1))
    if (x > (10**9+7)):
         print(x%(10**9+7))
    else:
         print(x)
L.append( max(L[-1], a) )

R=[]
for i,a in enumerate(A[::-1]):
	if i==0:
		R.append(a)
	else:
		R.append( max(R[-1], a) )

R=R[::-1]


for i in range(N):
	if i==0:
		print R[i+1]
	elif i==N-1:
		print L[i-1]
	else:
		print max( R[i+1], L[i-1])


### FIXED CODE ###

import sys
N=input()
A=[ int(sys.stdin.readline().strip())  for _ in range(N) ]

L=[]
for i,a in enumerate(A):
	if i==0:
		L.append(a)
	else:
		L.append( max(L[-1], a) )

R=[]
for i,a in enumerate(A[::-1]):
	if i==0:
		R.append(a)
	else:
		R.append( max(R[-1], a) )

R=R[::-1]


for i in range(N):
	if i==0:
		print R[i+1]
	elif i==N-1:
		print L[i-1]
	else:
		print max( R[i+1], L[i-1])
import math

def searchPrimeNum(N):
    maxV=int(math.sqrt(N))
    searchList=[i for i in range(2, N+1)]
    primeNum=[]
    while searchList[0]<=maxV:
        primeNum.append(searchList[0])
        tmp=searchList[0]
        searchList=[i for i in searchList if i%tmp!=0]
    primeNum.extend(searchList)
    return primeNum

A, B=map(int, input().split())
primeNum=searchPrimeNum(max(A, B))
ans=1
for p in primeNum:
    if A%p==0 and B%p==0:
        ans+=1
print(ans)

### FIXED CODE ###

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)
  return divisors

def make_cd(x, y):
  div1=make_divisors(x)
  div2=make_divisors(y)
  cd=[]
  for i in div1:
    for j in div2:
      if i==j:
        cd.append(i)
        break
  cd.sort()
  return cd

A, B=map(int, input().split())
if A<B:
  A,B=B,A
cd=make_cd(A, B)
ok=[True for _ in range(len(cd))]
for i in range(1, len(cd)):
  if not ok[i]:
    continue
  for j in range(i+1, len(cd)):
    if cd[j]%cd[i]==0:
      ok[j]=False
print(sum([1 if ok[i] else 0 for i in range(len(cd))]))
fuckoff


### FIXED CODE ###

n=int(input())
x=list(map(int,input().split()))
y=sorted(x)
k,l=y[n//2-1],y[n//2]
for i in range(n):
    if x[i]<=k:
        print(l)
    else:
        print(k)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 8)


n, m = list(map(int, input().split()))
dp = [-1]*n

xx = {}

g = [set() for i in range(n)]

for i in range(n-1):
    x, y = list(map(int, input().split()))
    x-=1
    y-=1
    g[x].add(y)
    g[y].add(x)

# sys.exit(0)

def solve(u, p):

    if (dp[u]!=-1):
        return dp[u]

    ans = 1
    for v in g[u]:
        if v==p:
            continue
        
        ans *= (1+solve(v, u))
    dp[u]=ans
    return ans
    

def solve2(u, p):
    #u is at the root
    xx[u]=dp[u]

    for v in g[u]:
        if v==p:
            continue
        dp[u]/=(1+dp[v])
        dp[v]*=(1+dp[u])
        solve2(v, u)
        dp[v]/=(1+dp[u])
        dp[u]*=(1+dp[v])
        
solve(0,-1)
solve2(0, -1)

for i in range(n):
    print(int(xx[i]%m))



### FIXED CODE ###

# coding: utf-8
# Your code here!
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

n,MOD = [int(i) for i in input().split()]

to = [[] for _ in [0]*n]
for _ in range(n-1):
    x,y = [int(i)-1 for i in input().split()]
    to[x].append(y)
    to[y].append(x)


dp = [[0]*len(to_i) for to_i in to]
parent_index = [-9999]*n 
ans = [0]*n

def dfs(v, p):
    res = 1
    for i, vc in enumerate(to[v]):
        if vc == p:
            parent_index[v] = i
            continue
        dp[v][i] = dfs(vc, v)
        res *= dp[v][i]+1
        res %= MOD
    return res

def dfs2(v, res_p, p):
    deg = len(to[v])
    if p >= 0:
        dp[v][parent_index[v]] = res_p

    accl = [1]*(deg+1)
    accr = [1]*(deg+1)

    for i in range(1, deg+1):
        accl[i] = accl[i-1] * (dp[v][i-1] + 1) % MOD
        accr[-i-1] = accr[-i] * (dp[v][-i] + 1) % MOD

    ans[v] = accr[0]
    for i,vc in enumerate(to[v]):
        if vc == p: continue
        dfs2(vc, accl[i]*accr[i+1]%MOD, v)

dfs(0,-1)
#print(dp)
dfs2(0,0,-1)
#print(dp)
for i in ans:
    print(i)
import sys
read = sys.stdin.read
readline = sys.stdin.buffer.readline
from collections import deque
INF = float('inf')


def main():
    H, W, K = map(int, readline().split())
    sy, sx, gy, gx = map(int, readline().split())
    sy -= 1
    sx -= 1
    gx -= 1
    gy -=1
    lake = read().split()
    dist = [[INF] * W for _ in range(H)]
    dxy = [[1, 0], [0, 1], [-1, 0], [0, -1]]
    Q = deque()
    Q.append((sy, sx))
    dist[sy][sx] = 0
    while Q:
        y,x,d = Q.popleft()
        if (y,x) == (gy, gx):
            print(d[y][x])
            quit()
        for dx,dy in dxy:
            n_y = y
            n_x = x
            for _ in range(K):
                n_y +=dy
                n_x +=dx

                if 0<=n_x<W and 0<=n_y<H and lake[n_y][n_x] != '@':
                    if dist[n_y][n_x]<d[y][x]:
                        break
                    elif dist[n_y][n_x] == INF:
                        dist[n_y][n_x] = d[y][x] + 1
                        Q.append((n_y,n_x))
                    else:
                        continue

                else:
                    break
    print('-1')

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from collections import deque
 
H, W, K = map(int,readline().split())
x1, y1, x2, y2 = map(int,readline().split())
x1 -= 1; y1 -= 1; x2 -= 1; y2 -= 1
C = read().split()

dist = [[-1]*W for i in range(H)]
dist[x1][y1] = 0
d = deque([[x1, y1]])
dxy= [[1, 0], [0, 1], [-1, 0], [0, -1]]
while d:
  x, y = d.popleft()
  if (x, y) == (x2, y2):
    print(dist[x][y])
    quit()
  for dx, dy in dxy:
    xx = x; yy = y
    for i in range(K):
      xx += dx; yy += dy
      if 0<=xx<H and 0<=yy<W and C[xx][yy]!='@':
        if 0 <= dist[xx][yy] <= dist[x][y]:
          break
        if dist[xx][yy] == -1:
           d.append([xx, yy])
        dist[xx][yy] = dist[x][y] + 1
      else:
        break

print(-1)
s = input()
    if s[0] == s[1] ==s[2]:
        print('No')
    elif s[0] == s[2] == s[3]:
        print('No')
    elif s[1] == s[2] == s[3]:
        print('No')
    elif s[0] == s[1] == s[2] == s[3]:
        print('No')
    elif s[0] == s[1]:
        if s[2] == s[3]:
            print('Yes')
        else:
            print('No')
    elif s[0] == s[2]:
        if s[1] == s[3]:
            print('Yse')
        else:
            print('No')
    elif s[0] == s[3]:
        if s[1] == s[2]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')


### FIXED CODE ###

s = sorted(input())
if (s[0] == s[1]) and (s[2] == s[3]) and (s[0] != s[2]):
        print('Yes')
elif (s[0] == s[2]) and (s[1] == s[3]) and (s[0] != s[1]):
        print('Yse')
elif (s[0] == s[3]) and (s[1] == s[2]) and (s[0] != s[1]):
        print('Yes')
else:
    print('No')
N,A,B=map(int,input().split())
c='b'*A+'a'*B
import math
for i in range(math.ceil(N/(A+B))+1):
    d=i*c
print(d.count('b',0,N))

### FIXED CODE ###

N,A,B=map(int,input().split())
if N == (N//(A+B))*(A+B):
    print(N-(N//(A+B))*(B))
elif (N//(A+B))*(A+B)<N <= (N//(A+B))*(A+B)+A:
    print(N-(N//(A+B))*(B))
else:
    print((N//(A+B)+1)*(A))
a,b=list(map(int,input().split()))

import math

print(len(a*b/math.gcd(a,b)))

### FIXED CODE ###


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

from fractions import gcd

res=a*b/gcd(a,b)
print(int(res))
N = int(input())

if N == 1:
  print("Hello World")
else if N == 2:
  A, B = map(int, input().split())
  print(A + B)


### FIXED CODE ###

N = int(input())

if N == 1:
  print("Hello World")
else :
  A = int(input())
  B = int(input())
  print(A + B)
N,Q = map(int,input().split())
aLst = [[int(x) for x in input().split()] for _ in range(N-1)]
pLst = [[int(x) for x in input().split()] for _ in range(Q)]

tmpLst = [[] for _ in range(N+1)]
for i, j in aLst:
    tmpLst[i].append(j)

ansLst= [0] * N
for i in range(Q):
    ansLst[pLst[i][0] - 1] += pLst[i][1]
def dfs(v, ansLst):
    for i in tmpLst[v]:
        ansLst[i - 1] += ansLst[v - 1]
        dfs(i, ansLst)


dfs(1, ansLst)

ans = ' '.join(map(str, ansLst))
print(ans)

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

# 遅延評価で加えてあげるだけ

N,Q = map(int,input().split())
AB = [[int(x) for x in input().split()] for _ in range(N-1)]
PX = [[int(x) for x in input().split()] for _ in range(Q)]

graph = [[] for _ in range(N+1)]
for a,b in AB:
    graph[a].append(b)
    graph[b].append(a)

value = [0] * (N+1)
for p,x in PX:
    value[p] += x
    
q = [(1,0)]
while q:
    x,parent = q.pop()
    value[x] += value[parent]
    for y in graph[x]:
        if y == parent:
            continue
        q.append((y,x))

answer = ' '.join(map(str,value[1:]))
print(answer)
N=int(input())

friendlist=[0 for i in range(N+2)]


for i in range(N):
    a,b=[int(j) for j in input().split(" ")]
    for k in range(a,min(b+1,N+2)):
        friendlist[k]+=1


#ab=[[int(i) for i in input().split(" ")] for j in range(N)]

#print(ab)

k=N+1
i=0
while k>=0:
    if friendlist[k]>=k-1:
        i=k-1
        break
    k-=1

print(i)
    
        

### FIXED CODE ###



N=int(input())

friendlist=[0 for i in range(N+2)]

"""
for i in range(N):
    a,b=[int(j) for j in input().split(" ")]
    for k in range(a,min(b+1,N+2)):
        friendlist[k]+=1
"""


ab=[[int(i) for i in input().split(" ")] for j in range(N)]
a=[ab[i][0] for i in range(N)]
b=[ab[i][1] for i in range(N)]

a.sort()
b.sort()



for i in range(1,N):
    for j in range(a[i-1],min(a[i],N+2)):
        friendlist[j]+=i
for i in range(a[N-1],N+2):
    friendlist[i]+=N

for i in range(1,N):
    for j in range(b[i-1]+1,min(b[i]+1,N+2)):
        friendlist[j]-=i
for i in range(b[N-1]+1,N+2):
    friendlist[i]-=N
        


#"""

k=N+1
i=0
while k>=0:
    if friendlist[k]>=k-1:
        i=k-1
        break
    k-=1

print(i)
def cost(i):
	if i <= 0:
		return 0
	else:
		tmp = float("inf")
		tmp = min(tmp, cost(i - 1) + abs(h[i] - h[i - 1]))
		tmp = min(tmp, cost(i - 2) + abs(h[i] - h[i - 2]))
		return tmp
N = int(input())
h = list(map(int, input().split()))
print(cost(N - 1))


### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))
dp = [float("inf") for _ in range(N)]
dp[0] = 0
for i in range(1, N):
	dp[i] = min(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]))
	if i > 1:
		dp[i] = min(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]))
print(dp[N - 1])
initInput = input()
tmpList = initInput.split()
inputN = int(tmpList[0])
inputA = int(tmpList[1])
inputB = int(tmpList[2])
arrayList = []
num = 0
arrayNum = 0
blueballNum = 0
while len(arrayList)  < inputN:
    if num % 2 == 0:
        for a in range(inputA):
            arrayList = arrayList +  ['a']
            arrayNum = arrayNum + 1
            blueballNum = blueballNum + 1
    else:
        for b in range(inputB):
            arrayList = arrayList +  ['b']
            arrayNum = arrayNum + 1

    num += 1

blueballNum = blueballNum - (len(arrayList) - inputN)
    
print(blueballNum)

### FIXED CODE ###

strStation = input()

if strStation == 'AAA' or strStation == 'BBB':
    print('No')
else:
    print('Yes')
S = input()
text = ['dream','dreamer','erase','eraser']

def search(s):
  if len(s) == 0:
    return 1
  
  flg = 0
  for t in text:
    if s.find(t) == 0:
      flg |= search(s[len(t):])
      
  return flg

if search(S):
  print('YES')
else:
  print('NO')
      

### FIXED CODE ###

S = input()[::-1]
text = ['dream','dreamer','erase','eraser']
text = [t[::-1] for t in text]

while len(S) > 0:
  for t in text:
    if S.find(t) == 0:
      S = S[len(t):]
      break
  else:
    print('NO')
    break
else:
  print('YES')
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)


### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
zero_flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)
N, C = map(int, input().split())
r = [[0] * C for _ in range(10 * 5)]
for _ in range(N):
    s, t, c = map(int, input().split())
    for i in range(s - 1, t):
        r[j][c - 1] = 1
ans = 0
for t in r:
    sum_t = sum(t)
    if sum_t > ans:
        ans = sum_t

print(ans)

### FIXED CODE ###

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

r = [[0 for i in range(c)] for j in range(100000)]  # テレビ局の番組表
for dummy in range(n):  # 入力
    s, t, c = map(int, input().split())
    for j in range(s - 1, t):
        r[j][c - 1] = 1  # 放送中なら1

ans = 0
for i in range(100000):
    if sum(r[i]) > ans:
        ans = sum(r[i])  # 同時に放送されている番組の最大数

print(ans)
n=int(input())
dat=list(map(int, input().split()))
      
re = 0

while (True):
       for e in dat:
            if e%2==1:
                return re
            else:
                e = e/2
         re = re+1

print(re)

### FIXED CODE ###

import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
def func(c,x):
    c[x][0] = 1
    for i in c[x][1:]:
        if c[i][0] == 0:
            func(c,i)
    return c

# 入力
N,M = map(int,input().split())
XYZ = list(list(map(int,input().split()))for i in range(M))
############################################
card = [[0]for i in range(N)]
set = 0
############################################
# グラフを描く
for x,y,z in XYZ:
    card[x-1].append(y-1)
    card[y-1].append(x-1)
############################################
for i in range(N):
    if card[i][0] == 0:
        set += 1
        card = func(card,i)
ans = set
############################################
for c in card:
    if c == 0:
        ans += 1
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000000)
def func(c,x):
    c[x][0] = 1
    for i in c[x][1:]:
        if c[i][0] == 0:
            func(c,i)
    return c

# 入力
N,M = map(int,input().split())
XYZ = list(list(map(int,input().split()))for i in range(M))
############################################
card = [[0]for i in range(N)]
set = 0
############################################
# グラフを描く
for x,y,z in XYZ:
    card[x-1].append(y-1)
    card[y-1].append(x-1)
############################################
for i in range(N):
    if card[i][0] == 0:
        set += 1
        card = func(card,i)
############################################
print(set)