Harryxun/stf_run huggingface dataset:
while(1):
  count = int(raw_input())
  if count == 0: break
  previous_cube = [1, 2, 3, 4, 5, 6]
  operation = {'North':[2, 6, 3, 4, 1, 5], 'East':[4, 2, 1, 6, 5, 3], 'West': [3, 2, 6, 1, 5, 4], 'South':[5, 1, 3, 4, 6, 2], 'Right':[1, 3, 5, 2, 4, 6], 'Left':[1, 4, 2, 5, 3, 6]}
  sum = 1
  for i in xrange(count-1):
    new_cube = []
    for e in xrange(5):
      new_cube.append(previous_cube[operation[str(raw_input())][e]])
    sum += new_cube[0]
    previous_cube = new_cube
  print sum

### FIXED CODE ###

while 1:
  n = input()
  if n == 0:  break
  d = range(1, 7)
  ans = 1
  for i in range(n):
    c = raw_input()[0]
    if c == 'N': S = [1,5,2,3,0,4]
    elif c == "S": S = [4,0,2,3,5,1]
    elif c == "E": S = [3,1,0,5,4,2]
    elif c == "W": S = [2,1,5,0,4,3]
    elif c == "R": S = [0,2,4,1,3,5]
    elif c == "L": S = [0,3,1,4,2,5]
    d = [d[s] for s in S]
    ans += d[0]
  print ans
N=int(input())

for i in range(1,N):
  if i*(i+1)//2 >= N:
    k=i
    break
    
c = int(k*(k+1)//2 - N)

for j in range(1,k+1):
  if j!=c:
    print(j)

### FIXED CODE ###

N=int(input())
k=1

for i in range(1,N+1):
  if i*(i+1)//2 >= N:
    k=i
    break
    
c = int(k*(k+1)//2 - N)

for j in range(1,k+1):
  if j!=c:
    print(j)
r1, c1, r2, c2 = map(int, input().split())
mod = 10**9+7

def cmb1(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = cmb1(r2+1+c2+1, r2+1, mod)-cmb1(r2+1+c1, c1, mod)-cmb1(r1+c2+1, r1, mod)+cmb1(r1+c1, c1, mod)
print(ans%mod)


### FIXED CODE ###

r1, c1, r2, c2 = map(int, input().split())
mod = 10**9+7

def cmb1(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 2*10**6+5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = cmb1(r2+1+c2+1, r2+1, mod)-cmb1(r2+1+c1, c1, mod)-cmb1(r1+c2+1, r1, mod)+cmb1(r1+c1, c1, mod)
print(ans%mod)
n = int(input())
a = map(int,input().split())
p = int(input())
m = map(int,input().split())
def goukei(i,m):
  if m ==0:
    return True
  if i >= n or m > sum(a):
    return False
  r = goukei(i + 1, m) or goukei(i + 1, m - a[i])
  return r
 
for u in range(answer):

  if s(0, m[u]):
    print "yes"
  else:
    print "no"
   

### FIXED CODE ###

n = int(input())
a = map(int,raw_input().split())
p = int(input())
m = map(int,raw_input().split())
def goukei(i,m):
  if m ==0:
    return True
  if i >= n or m > sum(a):
    return False
  r = goukei(i + 1, m) or goukei(i + 1, m - a[i])
  return r
 
for u in range(0,p):

  if goukei(0, m[u]):
    print "yes"
  else:
    print "no"
from math import ceil
from heapq import heapify, heappop, heappush

N, K, *A = map(int, open(0).read().split())

a = [(-i, i, 1) for i in A]
heapify(a)
while K != 0:
    i, j, k = heappop(a)
    #print(i, j, k)
    t = -a[0][0]
    nk = ceil(j / t)
    t = min(nk - k, K)
    K -= t
    k += t
    i = -(j / k)
    heappush(a, (i, j, k))
    #print(i, j, k)
print(ceil(heappop(a)[0] * -1))


### FIXED CODE ###

from math import ceil

N, K, *A = map(int, open(0).read().split())

def is_ok(n):
    t = 0
    for a in A:
        if a <= n:
            continue
        t += ceil(a / n) - 1
    return t <= K

ok = 1000000000
ng = 0.0000000001
while abs(ng - ok) > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m

print(ceil(ok))
s = sorted(set(list(str(input()))))
t = "abcdefghijklmnopqrstuvwxyz"
if len(s) == 26:
    print("None")
for i in range(26):
    if t[i] != s[i]:
        print(t[i])
        break

### FIXED CODE ###

s = sorted(set(list(str(input()))))
t = "abcdefghijklmnopqrstuvwxyz"
l = []
if len(s) == 26:
    print("None")
for i in range(26):
    if t[i] not in s:
        print(t[i])
        break
n,k=map(int,input().split())
p=list(map(int,input().split()))
e=[]
for i in range(n):
  ep=(1+p[i])*p[i]/(2*p[i])
  e.append(ep)
s=[e[0]]
for i in range(1,n):
  s.append(s[i-1]+e[i])
ans=s[k-1]
for i in range(k,n+1):
  ans=max(ans,s[i]-s[i-k])
print(ans)

### FIXED CODE ###

n,k=map(int,input().split())
p=list(map(int,input().split()))
e=[]
for i in range(n):
  ep=(1+p[i])*p[i]/(2*p[i])
  e.append(ep)
s=[e[0]]
for i in range(1,n):
  s.append(s[i-1]+e[i])
ans=s[k-1]
for i in range(k,n):
  ans=max(ans,s[i]-s[i-k])
print(ans)
N = int(input())
M = int(input())

A = [input()for i in range(M)]

x = N
#残り日数
for j in range(M):
    x = x - int(A[j])
    j += 1

if x < 0 :
    print(-1)

else :
    print(x)


### FIXED CODE ###

N,M = (input().strip().split())


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

x = int(N)
#残り日数
for j in range(int(M)):
    x = x - int(A[j])
    j += 1

if x < 0 :
    print(-1)

else :
    print(x)
def height(n):
    return sum([i for i in range(n+1)])

tower = []

for i in range(1, 1000):
    tower.append(height(i))

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

for i in tower:
    if tower[i] > a:
        ind = i-1
        break

print(abs(tower[ind] - a))

### FIXED CODE ###

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

print(int(((((1+ (b - a)) * (b - a)) / 2 - b))))
import numpy as np 
N,W==map(int,input().split())
w,v=[],[]
for i in range(N):
    a,b=map(int,input().split())
    w+=[a]
    v+=[b]
DP=np.ones(N*1000+1,dtype=int)*(W+1)
DP[0]=0
for i in range(N):
    DP[v[i]:]=np.minimum(DP[:-v[i]]+w[i],DP[v[i]:])
ans=0
for k in range(N*1000+1):
    if DP[k]<=W:
        ans=k
print(ans)

### FIXED CODE ###

import numpy as np 
N,W=map(int,input().split())
w,v=[],[]
for i in range(N):
    a,b=map(int,input().split())
    w+=[a]
    v+=[b]
DP=np.ones(N*1000+1,dtype=int)*(W+1)
DP[0]=0
for i in range(N):
    DP[v[i]:]=np.minimum(DP[:-v[i]]+w[i],DP[v[i]:])
ans=0
for k in range(N*1000+1):
    if DP[k]<=W:
        ans=k
print(ans)
a = int(input())
b=[]
b=list(map(int,input().split()))
sum1=0
num = []
for i in range(a-1):
  for j in range(i+1,a):
    num.append(b[i]^b[j])
sum1=sum(num)
 
if sum1>=1000000007:
  sum1=sum1%1000000007
print(sum1)

### FIXED CODE ###

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

if a+b+c>=22:
  print('bust')
else:
  print('win')
S=input()
ans=0
tmp=0
for s in S:
  if s='S':
    tmp+=1
  else:
    ans=max(ans,tmp)
    tmp=0
print(max(ans,tmp))

### FIXED CODE ###

S=input()
ans=0
tmp=0
for s in S:
  if s=='R':
    tmp+=1
  else:
    ans=max(ans,tmp)
    tmp=0
print(max(ans,tmp))
N = int(input())
if N // 1.08 == (N+1) //1.08:
    print(':(')
else:
    print(n+1)

### FIXED CODE ###

N = int(input())
n = int(N/1.08)
if (int(n * 1.08) < N and N < int((n+1) * 1.08)):
    print(':(')
else:
    print(int(N//1.08)+1)
def main():
    n, m = map(int, input().split())

    dag = [[] for _ in range(n+1)]
    for _ in range(m):
        src, dst = map(int, input().split())
        dag[src].append(dst)

    # Distance of longest path starting at node i
    dists = [0] * (n+1)

    def longest(v):
        if dists[v]:
            return dists[v]
        for to in dag[v]:
            dists[v] = max(dists[i], longest(to) + 1)
        return dists[v]

    max_len = 0
    for i in range(1, n+1):
        max_len = max(max_len, longest(i))

    print(max_len)



if __name__ == '__main__':
    main()



### FIXED CODE ###

from collections import deque

def main():
    n, m = map(int, input().split())
    graph = [[] for _ in range(n+1)]
    parents = [0] * (n+1)
    for _ in range(m):
        src, dst = map(int, input().split())
        graph[src].append(dst)
        parents[dst] += 1

    q = deque()
    for i in range(1, n+1):
        if parents[i] == 0:
            q.append(i)

    dists = [0] * (n+1)
    for i in q:
        dists[0] = 0

    while q:
        at = q.popleft()
        for to in graph[at]:
            parents[to] -= 1
            if parents[to] == 0:
                q.append(to)
                dists[to] = dists[at] + 1

    print(max(dists[1:]))


if __name__ == '__main__':
    main()
s = input()
K = int(input())
A =[]
for i in range(len(s)):
  for j in range(len(s)):
    if j > i:
      A.append(s[i:j])
for i in range(len(s)):
  A.append(s[i])
B = set(A)
B = list(B)
B = sorted(B)
print(B[K-1])

### FIXED CODE ###

s = input()
K = int(input())
A =[]
b = len(s)
for i in range(b+1):
      if i+1 < b+1:
        A.append(s[i:i+1])
      if i+2 < b+1:
        A.append(s[i:i+2])
      if i+3 < b+1:
        A.append(s[i:i+3])
      if i+4 < b+1:
        A.append(s[i:i+4])
      if i+5 < b+1:
        A.append(s[i:i+5])
B = set(A)
B = list(B)
B = sorted(B)
print(B[K-1])
N, M = map(int, input().split())
L = []
R = []
D = []
for i in range(M):
    l, r, d = map(int, input().split())
    L.append(l)
    R.append(r)
    D.append(d)

inf = float("inf")


class WDG():  # 重み付き有向グラフ(隣接リスト表現)
    class node():
        def __init__(self, index=0, weight=0, next=None):
            self.index = index
            self.weight = weight
            self.next = next

    def __init__(self, N, M, L, R, D):
        self.heads = []
        self.x = [None] * N
        self.N = N
        for i in range(N):
            head = WDG.node()
            head.next = head
            head.index = i
            self.heads.append(head)
        for i in range(M):
            new1 = WDG.node(R[i] - 1, D[i], head)
            new2 = WDG.node(L[i] - 1, -D[i], head)
            self.insert(L[i] - 1, new1)
            self.insert(R[i] - 1, new2)

    def insert(self, start, new):
        new.next = self.heads[start].next
        self.heads[start].next = new

    def show_graph(self):
        for i in self.heads:
            node = i.next
            print("{}=>".format(i.index + 1), end="")
            while node != i:
                print("{}({})".format(node.index + 1, node.weight), end=" ")
                node = node.next
            print("")

    def _DFS(self, s_head):  # 始点sから到達できる連結成分を深さ優先探索
        node = s_head.next
        while node != s_head:
            new_x = self.x[s_head.index] + node.weight
            if self.x[node.index] is not None and self.x[node.index] != new_x:
                #print("node{}NG".format(node.index + 1))
                return False
            elif self.x[node.index] == new_x:
                pass
            else:
                #print("node{}".format(node.index + 1))
                self.x[node.index] = new_x
                return self._DFS(self.heads[node.index])
            node = node.next
        return True

    def DFS(self):  # すべての点を訪れるまで深さ優先探索
        for i in range(self.N):
            node = self.heads[i]
            if self.x[node.index] is None:
                self.x[node.index] = 0
                if not self._DFS(self.heads[node.index]):
                    return "No"
        return "Yes"


G = WDG(N, M, L, R, D)
# G.show_graph()
print(G.DFS())


### FIXED CODE ###

from collections import deque
N, M = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(M):
    l, r, d = map(int, input().split())
    G[l - 1].append((r - 1, d))
    G[r - 1].append((l - 1, -d))
q = deque()

x = [None] * N


def _BFS(start):
    q.append(start)
    while len(q) != 0:
        p = q.popleft()
        for index, d in G[p]:
            if x[index] is None:
                x[index] = x[p] + d
                q.append(index)
            elif x[index] != x[p] + d:
                return False
    return True


def BFS():
    for i in range(N):
        if x[i] is None:
            x[i] = 0
            if not _BFS(i):
                return "No"
    return "Yes"


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

dp = [0]*n
for i in range(n):
    now = a[i]
    if i%2 == 0:
        dp[i//2] = now
    else:
        dp[-(i//2 + 1)] = now
print(" ".join(map(str, a)))


### FIXED CODE ###

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

dp = [0]*n
for i in range(n):
    now = a[i]
    if i%2 == 0:
        dp[i//2] = now
    else:
        dp[-(i//2 + 1)] = now
print(" ".join(map(str, dp)))
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-1):
  if H[i]-H[i+1]=1:
    H[i] = H[i]-1
  elif H[i]-H[i+1]>1:
    cnt = 1
    break
if cnt == 0:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

A,B,C = map(int,input().split())
ans = C-(A-B)
if ans<=0:
  print(0)
else:
  print(ans)
li1 = []
li2 = []
for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c))
li3 = list(zip(*li2))[1]
print(sum(li3))
print(len(li3), *li3)



### FIXED CODE ###

li1 = []
li2 = []
for i, s in enumerate(input()):
    if s == "\\":
        li1.append(i)
    elif s == "/" and li1:
        j = li1.pop()
        c = i - j
        while li2 and li2[-1][0] > j:
            c += li2[-1][1]
            li2.pop()
        li2.append((j, c))
if li2:
    li3 = list(zip(*li2))[1]
    print(sum(li3))
    print(len(li3), *li3)
else:
    print(0, 0, sep="\n")
S = input()
K = int(input())
 
T = list(S * K)
T.append("0")
count = 0
 
for i in range(len(T)-1):
    if T[i] == T[i+1]:
        T[i+1] = "1"
        count += 1
 
print(count)

### FIXED CODE ###

import copy

S = list(input())
K = int(input())

def Scount():
    cnt_S = 0
    for i in range(len(S)-1):
        if S[i] == S[i+1]:
            S[i+1] = "1"
            cnt_S += 1
    return cnt_S

T = copy.copy(S)
T.insert(0, T[len(T)-1])
cnt_T = 0
for i in range(len(T)-1):
    if T[i] == T[i+1]:
        T[i+1] = "1"
        cnt_T += 1

if T[i+1] != "1":
    ans = Scount() + (cnt_T * (K-1))
else:
    TT = S * 2
    cnt_T = 0
    for i in range(len(TT)-1):
        if TT[i] == TT[i+1]:
            TT[i+1] = "1"
            cnt_T += 1
    if K % 2 == 0:
        ans = cnt_T * (K // 2)
    else:
        ans = (cnt_T * (K // 2)) + Scount()
print(ans)
a,b = map(int,input().split())

ans = a*b % 2
if ans == 0:
  print(Even)
else:
  print(Odd)


### FIXED CODE ###

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

ans = a*b % 2
if ans == 0:
  print("Even")
else:
  print("Odd")
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
k,a,b = map(int, input().split())

if a >= b:
  print(k+1)
elif k==1:
  print(b)
elif k==2:
  print(b)
elif k<=a:
  print(k+1)
else:
  t=((k+1)//(a+2))
  r=(k+1)-t*(a+2)
  if a < (b-a):
    nn = (k+1)-a
    print(nn//2*(b-a)+a+((k+1)-a)%2) 
  else:
    print(max(t*b+r,k+1))


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n,k = map(int, input().split())
if n==1 and k==1:
  print('YES')
elif n <= k:
  print('NO')
elif n < ((k-1)*2+1) :
  print('NO')
else:
  print('YES')
A,B,X=map(int,input().split())
print((X-A)%B)

### FIXED CODE ###

x=int(input())
a=int(input())
b=int(input())
print((x-a)%b)
global primeList
primeList = []

def primeFactorize(X):
  global primeList
  result = set()
  for prime in primeList:
      if X % prime == 0:
        result.add(prime)
  return result

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

isPrime = [True for i in range(1000001)]
isPrime[0] = isPrime[1] = False;
primeList.append(2)
for i in range(4,1000001,2):
  isPrime[i] = False

for i in range(3,1000001,2):
    if not isPrime[i]:
      continue
    primeList.append(i)
    for j in range(i, 1000001//i + 1):
      isPrime[i*j] = False

pA = primeFactorize(A)
pB = primeFactorize(B)
print(len(pA.intersection(pB)) + 1)




### FIXED CODE ###

global primeList
primeList = []

def primeFactorize(X):
  global primeList
  result = set()
  for prime in primeList:
      while X % prime == 0:
        result.add(prime)
        X //= prime
  if X != 1:
      result.add(X)
  return result

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

isPrime = [True for i in range(1000001)]
isPrime[0] = isPrime[1] = False;
primeList.append(2)
for i in range(4,1000001,2):
  isPrime[i] = False

for i in range(3,1000001,2):
    if not isPrime[i]:
      continue
    primeList.append(i)
    for j in range(i, 1000000//i + 1):
      isPrime[i*j] = False

pA = primeFactorize(A)
pB = primeFactorize(B)
print(len(pA.intersection(pB)) + 1)
a,b=map(int,input().split())
if 2*a<=b and b<=4*a and b%2==0:
  print('yes')
else:print('no')

### FIXED CODE ###

l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    break
n=int(input())
al=[chr(ord('a') + i) for i in range(26)]
sakai=[]
k=0
for i in range(10):
  k+=26**(i+1)
  sakai.append(k)

if n<=26:
  n-=1
  u=1
elif n>sakai[9]:
  n-=sakai[9]+1
  u=11
for i in range(9):
  if (sakai[i]<n<=sakai[i+1]):
    n-=sakai[i]+1
    u=i+2

def base(n):
  ans=[]
  while(n>26):
    r=n%26
    n=(n-r)//26
    ans.append(r)
  ans.append(n)
  return ans


p=base(n)

if u-len(p)>0:
  ans_3='a'
  if u-len(p)>1:
    for j in range(u-len(p)-1):
      ans_3+='a'
    
for i in range(len(p)):
  if i==0:
    ans_2=al[p[len(p)-i-1]]
  else:
    ans_2=ans_2+al[p[len(p)-i-1]]
if u-len(p)>0:
  print(ans_3+ans_2)
else:
  print(ans_2)
               

### FIXED CODE ###

n=int(input())
al=[chr(ord('a') + i) for i in range(26)]
sakai=[]
k=0
for i in range(10):
  k+=26**(i+1)
  sakai.append(k)

if n<=26:
  n-=1
  u=1
elif n>sakai[9]:
  n-=sakai[9]+1
  u=11
for i in range(9):
  if (sakai[i]<n<=sakai[i+1]):
    n-=sakai[i]+1
    u=i+2

def base(n):
  ans=[]
  while(n>=26):
    r=n%26
    n=(n-r)//26
    ans.append(r)
  ans.append(n)
  return ans


p=base(n)

if u-len(p)>0:
  ans_3='a'
  if u-len(p)>1:
    for j in range(u-len(p)-1):
      ans_3+='a'
    
for i in range(len(p)):
  if i==0:
    ans_2=al[p[len(p)-i-1]]
  else:
    ans_2=ans_2+al[p[len(p)-i-1]]
if u-len(p)>0:
  print(ans_3+ans_2)
else:
  print(ans_2)
N = int(input())

n = len(str(N))
if n % 2 == 0:
    s = "90" * (n//2)
    print(s[:-1])
    
else:
    s = "90" * ((n-1) // 2)
    ans = int(s[:-1]) + N - 10**(n-1) + 1
    print(ans)

### FIXED CODE ###

N = int(input())

n = len(str(N))
if n == 1:
    print(N)
else:
    if n % 2 == 0:
        s = "90" * (n//2)
        print(s[:-1])
        
    else:
        s = "90" * ((n-1) // 2)
        ans = int(s[:-1]) + N - 10**(n-1) + 1
        print(ans)
N = input()
D = input()
n = int(N)
d = int(D)
k = (n+2*d)/(2*d+1)
print(k)

### FIXED CODE ###

r = input()
a = int(r)
print(3*a*a)
n, a = [int(input()) for _ range(2)]
print("Yes" if (n%500)<=a else "No")

### FIXED CODE ###

n, a = [int(input()) for _ in range(2)]
print("Yes" if n%500<=a else "No")
l = input().split()
h,w = int(l[0]),int(l[1])
maze = []
for i in range(h):
    maze.append(list(input()))
dx = [1,0,-1,0]
dy = [0,1,0,-1]
for i in range(h):
    for j in range(w):
        if maze[i][j] == "#" or maze[i][j] == 1:
            for k in range(4):
                if 0<=i+dx[k]<w and 0<=j+dy[k]<h:
                    if maze[i+dx[k]][j+dy[k]]=="#" or maze[i+dx[k]][j+dy[k]]==1:
                        maze[i+dx[k]][j+dy[k]]=1
flag = 0
for i in range(h):
    for j in range(w):
        if maze[i][j] == "#":
            print("No")
            flag = 1
            break
if flag != 1:
    print("Yes")

### FIXED CODE ###

l = input().split()
h,w = int(l[0]),int(l[1])
mapxy = []
for i in range(h):
    mapxy.append(list(input()))
dx = [1,0,-1,0]
dy = [0,1,0,-1]
flag1 = 0
flag2 = 0
for i in range(h):
    for j in range(w):
        if mapxy[i][j] == "#":
            for k in range(4):
                if 0<=i+dy[k]<h and 0<=j+dx[k]<w:
                    if mapxy[i+dy[k]][j+dx[k]] == "#":
                        flag1 = 1
            if flag1 == 0:
                flag2 = 1
                break
            flag1 = 0
    if flag2 == 1:
        print("No")
        break
if flag2 != 1:
    print("Yes")
import math as m
n = int(input())
numbers = map(int,input().split())
order = []
 
for i in range(n):
  if numbers[i] == 0:
    a = 0
  else:
    a = m.floor(m.log(numbers[i],2))
  order.append(a)
print(min(order))

### FIXED CODE ###

N = int(input())
numbers =map(int,input().split())
ans = 10000
for i in numbers:
  count = 0
  while i % 2 == 0:
    i /= 2
    count += 1
  ans = min(ans,count)

print(ans)
X, N = input().split()
X = int(X)
N = int(N)

if N == 0:
    print(X)
    exit()

P = input().split()
for i in range(len(P)):
    P[i] = int(P[i])

if X not in P:
    print(X)
    exit()

flag_p = True
flag_n = True

abs_num = 0
abs_num_p = X + 1
abs_num_n = X - 1
while True:

    if abs_num_p in P:
        flag_p = True
    else:
        flag_p = False

    if abs_num_n in P:
        flag_n = True
    else:
        flag_n = False

    if(flag_p == True & flag_n == True):
        abs_num_p += 1
        abs_num_n -= 1
        continue;
    elif(flag_p == True & flag_n == False):
        print(abs_num_n)
        break;
    elif(flag_p == False):
        print(abs_num_p)
        break;


### FIXED CODE ###

import numpy as np

X = np.array(input().split())

for i in range(len(X)):
    if (i+1) != int(X[i]):
        print(i+1)
        break;
S = ipnut()
T = input()
 
if(S==T[:len(S)-1]):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

S = input()
T = input()
 
if(S==T[:len(S)]):
  print("Yes")
else:
  print("No")
a=input()
b=input()
print a*b
print (2*a)+(2*b)


### FIXED CODE ###

a,b=map(int,raw_input().split())
print a*b,2*(a+b)
n = int(input())
d = list(map(int,input().split()))
p = 0
q = 0
d.sort(key=int)
if (len(d))%2 == 0:
  m = (d[(len(d)//2)-1]+d[len(d)//2])/2
else:
  m = d[(len(d)//2)]
for i in range(len(d)):
  if d[i]>=m:
    if d[i] == d[i+1]:
      break
    else:
      p = d[i]
      q = d[i-1]
      break
print(p-q)

### FIXED CODE ###

n = int(input())
d = sorted(list(map(int,input().split())))
print(d[n//2]-d[n//2-1])
A, B = map(int, input().split())
print((A*(B*100))//100)

### FIXED CODE ###

A, B = input().split()
A = int(A)
B = float(B)
print(int(A*int(round(B*100))//100))
x = input()
x = int(x)

for i in 100000:
    if x == 0:
        break
    else:
        print("Case", i+1, ":", x)



### FIXED CODE ###

for i in range(10000):
    x = input()
    x = int(x)
    
    if x == 0:
        break
    else:
        print("Case "+ str(i+1) + ": " + str(x))
from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    s = (L[0]+L[1])/2
    L = L[2:] 
    heappush(L,s)
ans = heapq.heappop(L)
print(ans)

### FIXED CODE ###

from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    a= heappop(L)
    b= heappop(L)
    s=(a+b)/2
    heappush(L,s)
print(s)
def cost( i,k,j ):
  return m[i][k] + m[k+1][j] + p[i][0] * p[k][1] * p[j][1]
 
n = input()
M = []
m = [[ 0 for i in xrange(n) ] for j in xrange(n) ]
for i in xrange(n):
  M.append( map (int, raw_input().split() ) )
 
M_long = len(M)
for l in xrange( 2,M_long+1 ):
  for i in xrange( 0,M_long-l+1 ):
    j = i+l-1
    m[i][j] = min( cost( i,k,j ) for k in xrange( i,j ) )
 
print m[0][M_long-1]

### FIXED CODE ###

def cost( i,k,j ):
  return m[i][k] + m[k+1][j] + M[i][0] * M[k][1] * M[j][1]
 
n = input()
M = []
m = [[ 0 for i in range(n) ] for j in range(n) ]
for i in range(n):
  M.append( map (int, raw_input().split() ) )
 
M_long = len(M)
for l in range( 2,M_long+1 ):
  for i in range( 0,M_long-l+1 ):
    j = i+l-1
    m[i][j] = min( cost( i,k,j ) for k in range( i,j ) )
 
print m[0][M_long-1]
n = int(input())
d = int(input())
ans = n/(2*d + 1)
if n % (2*d + 1) != 0:
  print(ans+1)
else:
  print(ans)


### FIXED CODE ###

n, d = map(int,input().split())
ans = n // (2*d + 1)
if n % (2*d + 1) == 0:
  print(ans)
else:
  print(ans+1)