Chloe, the same as Vladik, is a competitive programmer. She didn't have any problems to get to the olympiad like Vladik, but she was confused by the task proposed on the olympiad.

Let's consider the following algorithm of generating a sequence of integers. Initially we have a sequence consisting of a single element equal to 1. Then we perform (n - 1) steps. On each step we take the sequence we've got on the previous step, append it to the end of itself and insert in the middle the minimum positive integer we haven't used before. For example, we get the sequence [1, 2, 1] after the first step, the sequence [1, 2, 1, 3, 1, 2, 1] after the second step.

The task is to find the value of the element with index k (the elements are numbered from 1) in the obtained sequence, i. e. after (n - 1) steps.

Please help Chloe to solve the problem!


-----Input-----

The only line contains two integers n and k (1 ≤ n ≤ 50, 1 ≤ k ≤ 2^{n} - 1).


-----Output-----

Print single integer — the integer at the k-th position in the obtained sequence.


-----Examples-----
Input
3 2

Output
2
Input
4 8

Output
4


-----Note-----

In the first sample the obtained sequence is [1, 2, 1, 3, 1, 2, 1]. The number on the second position is 2.

In the second sample the obtained sequence is [1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1]. The number on the eighth position is 4.

Difficulty: interview

Starter code:

Solutions:
n, k = map(int, input().split())

res = 1
while (k % 2 == 0):
    res += 1
    k //= 2
print(res)

def main():
    n, k = list(map(int, input().split()))
    while (n != 0):
        if (k == (2**(n - 1))):
            print(n)
            return
        else:
            k = k % (2**(n - 1))
        n -= 1
main()

n, k = list(map(int, input().split()))
res = 1
while (k & 1) == 0:
  k >>= 1
  res += 1
print(res)


n, k = map(int, input().split())
i = 1
while (k % 2 == 0):
    k /= 2
    i += 1
print(i)

def f(n, k):
    m = our[n]
    if m // 2 + 1 == k:
        return n
    return f(n - 1, k % (m // 2 + 1))


our = [0, 1]
n, k = map(int, input().split())
while len(our) <= n + 1:
    our.append(our[-1] * 2 + 1)
print(f(n, k))

n, k = list(map(int, input().split()))
finish = False
length = 1
for i in range(n-1):
    length = length * 2 + 1    
while n!=1:
    gran = length // 2 + 1
    if k == gran:
        print(n)
        finish = True
        break
    if k < gran:
        length = length // 2
        n -= 1
    if k > gran:
        k -= (length // 2 + 1)
        length = length // 2
        n -= 1  
if not finish:
    print(1)



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

def f(i,j):
    l = (1<<(i-1))
    if j==l:
        return i
    elif j<l:
        return f(i-1, j)
    else:
        return f(i-1, l-(j-l))

print(f(n,k))

def go(n, m):
    t = 2**(n-1)
    if m == t:
        return n
    else:
        if m < t:
            return go(n-1, m)
        else:
            return go(n-1, m-t)
n, m = map(int, input().split())
print(go(n, m))

def p(n, k):
    if k == 2 ** (n - 1):
        return(n)
    if k > 2 ** (n - 1):
        k -= 2 ** (n - 1)
    return p(n - 1, k)

n, k = map(int, input().split())
print(p(n, k))

n, k = [int(x) for x in input().strip().split(" ")]
le = 2**n - 1

def binsearch(level, le, ind):
	if level == 1:
		return 1
	if ind == le // 2 + 1:
		return level
	if ind > le // 2 + 1:
		ind -= le // 2 + 1
	return binsearch(level-1, le//2, ind)

print(binsearch(n,le,k))

n, k = list(map(int, input().split()))
k -= 1
x = 1
while True:
    if k % 2 ** x == 2 ** (x - 1) - 1:
        print(x)
        break
    x += 1

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

s = 0
while not(k % 2):
    s += 1
    k //= 2
    
print(s + 1)

def rec(depth, pos):
    if pos > 2 ** (depth - 1):
        rec(depth - 1, pos - 2 ** (depth - 1))
    elif pos == 2 ** (depth - 1):
        print(depth)
        return
    else:
        rec(depth - 1, pos)
    return

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

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

def nk(n, k):
    if n == 1: return 1
    t = 2**(n-1)
    if k == t: return n
    if k < t: return nk(n-1,k)
    else: return nk(n-1,k-t)

print(nk(n, k))

import sys
n, k = list(map(int, input().split()))
v = k
k -= 1
sum = 0
for i in range(1, n + 1):
    if ((k - sum) % 2 == 0):
        print(i)
        break
    sum += v // (1 << i)


n, k = [int(s) for s in input().split()]

lengths = [1]

n, k = n-1, k-1

for i in range(n):
    lengths.append(lengths[-1] * 2 + 1)

def search(n, k):
    if k == 0:
        return 1
    l = lengths[n]
    if k == l // 2:
        return n + 1
    if k < l // 2:
        return search(n-1, k)
    else:
        return search(n-1, k - l//2 - 1)

print(search(n, k))


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

def dfs(q, d):
    q = q % (2**(d-1))
    if (q == 0):
        print(d)
    else:
        dfs(q, d-1)

dfs(k, n)

n , k = map(int, input().split())
res = 0
while k % 2 == 0:
    k /= 2
    res += 1
print(res + 1)

n, k = map(int, input().split())
now = n
while True:
    if k == 2 ** (now - 1):
        print(now)
        break
    else:
        now -= 1
        k %= 2 ** now

import string
import math

line=input()
n=int(line.split(" ")[0])
k=int(line.split(" ")[1])

def search(l,r,k,dep):
    mid=(l+r)/2
    if k==mid or l==r:
        return(dep)
    if k<mid:
        return search(l,mid-1,k,dep-1)
    if k>mid:
        return search(mid+1,r,k,dep-1)

print(search(1,pow(2,n)-1,k,n))


def solve(n, k):
    if n == 1:
        return 1
    if k == 2 ** (n - 1):
        return n
    return solve(n - 1, k % (2 ** (n - 1)))

n, k = map(int, input().split())
print(solve(n, k))

n, k = map(int, input().split())
a = 0
while k % 2 == 0:
    a += 1
    k /= 2
print(a + 1)

# coding=utf-8
__author__ = 'Alexander'


def f(n,k):
    t = 2 ** (n-1)

    if k == t:
        return n
    elif k < t:
        return f(n-1, k)
    else:
        return f(n-1, k-t)

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

print(f(n,k))

n, k = map(int, input().split())
cnt = 0
while k % 2 == 0:
    k = k // 2
    cnt += 1
print(cnt + 1)

import math

n, k = list(map(int, input().split()))
arr = reversed([int(math.pow(2, i)) for i in range(50)])

for index, num in enumerate(arr):
	if k % num == 0:
		print(50 - index)
		break