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!

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

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

NoteIn 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.

import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main {
	public static void main(String[] args) throws Exception {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskA {
		int[] dx = { 1, 0, -1, 0, -1, -1, 1, 1 }, dy = { 0, 1, 0, -1, -1, 1 - 1, 1 };
		int MAX = (int) (0);
		ArrayList[] list;
		HashMap<String, String> map;

		// GCD && LCM
		long gcd(long a, long b) {
			return b == 0 ? a : gcd(b, a % b);
		}

		long lcm(long a, long b) {
			return a * (b / gcd(a, b));
		}

		// REverse a String
		String rev(String s) {
			return new StringBuilder(s).reverse().toString();
		}

		/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SOLUTION IS RIGHT HERE^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
		boolean[] vis;
		int[] res;

		public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
			int n = in.nextInt();
			long k = in.nextLong();
			long low = 0, high = (1l<<n)-1;

			while(low < high){
				long mid = (low+high)/2;
				if(mid == k-1){
					out.println(n);
					break;
				}
				//out.println(low+" "+high);

				n--;
				if(k-1 > mid)
					low = mid;
				else
					high = mid;
				//break;
			}
		}
	}

	// pair class
	static class pair implements Comparable<pair> {
		int first, second;

		public pair() {
			this.first = 0;
			this.second = 0;
		}

		public pair(int f, int s) {
			this.first = f;
			this.second = s;
		}

		@Override
		public int compareTo(pair one) {
			if (this.first < one.first)
				return -1;
			if (this.first > one.first)
				return 1;
			if (this.second < one.second)
				return -1;
			if (this.second > one.second)
				return 1;
			return 0;
		}

	}

	/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^`````````````````````````^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
	static class InputReader {
		private byte[] buf = new byte[8000];
		private int index;
		private int total;
		private InputStream in;
		// BufferedReader br = new BufferedReader(new
		// InputStreamReader(System.in));

		public InputReader(InputStream stream) {
			in = stream;
		}

		public int scan() {
			if (total == -1)
				throw new InputMismatchException();
			if (index >= total) {
				index = 0;
				try {
					total = in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public long scanlong() {
			long integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		private int scanInt() {
			int integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double scandouble() {
			double doubll = 0;
			int n = scan();
			int neg = 1;
			while (isWhiteSpace(n))
				n = scan();
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doubll *= 10;
					doubll += n - '0';
					n = scan();
				}
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doubll += (n - '0') * temp;
						n = scan();
					}
				}
			}
			return neg * doubll;
		}

		private float scanfloat() {
			float doubll = 0;
			int n = scan();
			int neg = 1;
			while (isWhiteSpace(n))
				n = scan();
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doubll *= 10;
					doubll += n - '0';
					n = scan();
				}
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doubll += (n - '0') * temp;
						n = scan();
					}
				}
			}
			return neg * doubll;
		}

		public String scanstring() {
			StringBuilder sb = new StringBuilder();
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			while (!isWhiteSpace(n)) {
				sb.append((char) n);
				n = scan();
			}
			return sb.toString();
		}

		public String scan_nextLine() {
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(n);
				n = scan();
			} while (!isEndOfLine(n));
			return res.toString();
		}

		public boolean isWhiteSpace(int n) {
			if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
				return true;
			return false;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
		/// Input module

		public int nextInt() {
			return scanInt();
		}

		public long nextLong() {
			return scanlong();
		}

		public double nextDouble() {
			return scandouble();
		}

		public float nextFloat() {
			return scanfloat();
		}

		public String next() {
			return scanstring();
		}

		public String nextLine() throws IOException {
			return scan_nextLine();
		}

		public int[] readintArray(int size) {
			int[] array = new int[size];
			for (int i = 0; i < size; i++) {
				array[i] = nextInt();
			}
			return array;
		}

		public Integer[] readIntegerArray(int size) {
			Integer[] array = new Integer[size];
			for (int i = 0; i < size; i++) {
				array[i] = nextInt();
			}
			return array;
		}
	}

}

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class ChloeSequence2 {

	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		//int k = sc.nextInt();
		long k = sc.nextLong();

		int ans=-1;

		if(k%2 != 0)
		{
			ans = 1;
		}
		else
		{
			if(n==2)
			{
				ans=2;
			}
			else
			{
				//int arr[] = new int[n+1];
				long arr[] = new long[n+1];
				arr[0]=-1;
				arr[1]=-1;
				arr[2]=0;
				int end=2;
				for(int i=3;i<=n;i++)
				{
					arr[i] = (2*arr[i-1])+1;
					if(k < (arr[i]*2)+1){
						end=i;
						break;
					}
					if(i==n && end==2)
						end=i;
				}

				/*
				for(int i=0;i<=n;i++)
					System.out.print(arr[i]+" ");
				System.out.println();
				*/
				int j=end;
				long loc = (arr[end]*2)+2;
				while(true)
				{
					//System.out.print(loc+" ");
					if(loc==k){
						ans=j;
						break;
					}
					else if(k < loc){
						loc = loc - ((arr[j-1]*2)+2);
					}
					else if(k > loc){
						loc = loc + ((arr[j-1]*2)+2);
					}
					j--;
				}

			}

		}//end else main

		System.out.println(ans);
	}

}

/*
 * DA-IICT
 * Author: Jugal Kalal
 */
import java.util.*;
import java.io.*;
import java.math.*;
import java.text.DecimalFormat;
public class HackerEarth{
	static long MOD=(long)Math.pow(10,9)+7;
	public static void main(String args[]) {
        new Thread(null, new Runnable() {
            public void run() {
                try{
                    solve();
                    w.close();
                }
                catch(Exception e){
                    e.printStackTrace();
                }
            }
        }, "1", 1 << 26).start();
	}
	static InputReader in;
    static PrintWriter w;
    static void solve(){
        in = new InputReader(System.in);
        w = new PrintWriter(System.out);
        int n=in.nextInt();
        long k=in.nextLong();
        if(k%2l==1l){
        	w.println(1);
        }else{
        	for(long i=1l;i<=n+1l;i++){
        		if((k+Math.pow(2l,i))%Math.pow(2l,i+1l)==0l){
        			w.println(i+1l);
        			break;
        		}
        	}
        }
    }
    static ArrayList<Integer> adj[]; //Adjacency Lists
    static int V;   // No. of vertices
    // Constructor
    static void Graph(int v){
        V = v;
        adj = new ArrayList[v];
        for (int i=0; i<v; ++i){
        	adj[i] = new ArrayList();
        }
    }
    // Function to add an edge into the graph
    static void addEdge(int u,int v){
		adj[u].add(v);
		adj[v].add(u);
    }
//    static long[] isHamiltonian_path(int n){
//    	boolean dp[][]=new boolean[n][1<<n];
//    	long ans[]=new long[n];
//    	long sum[]=new long[n];
//    	for(int i=0;i<n;i++){
//    		dp[i][1<<i]=true;
//    		ans[i]=0;
//    		sum[i]=i+1;
//    	}
//    	for(int mask=0;mask<(1<<n);mask++){
//    		int s=0;
//    		int count=0,temp=mask;
//    		while(temp>0){
//    			s+=1+Math.log(temp&(-temp))/Math.log(2);
//    			temp=temp&(temp-1);
//    			count++;
//    		}
//    		for(int j=0;j<n;j++){
//    			if((mask&(1<<j))>0){
//    				for(int k=0;k<n;k++){
//    					if(j!=k&&(mask&(1<<k))>0&&adj[j][k]&&dp[k][mask^(1<<j)]){
//    						dp[j][mask]=true;
//    						ans[j]=Math.max(ans[j],count-1);
//    						if(ans[j]==count-1){
//    							sum[j]=Math.max(sum[j], s);
//    						}
//    					}
//    				}
//    			}
//    		}
//    	}
//    	return sum;
//    }
//    static void bfs(int s,int n){
//    	boolean visited[]=new boolean[n];
//    	LinkedList<Integer> queue=new LinkedList<Integer>();
//    	queue.add(s);
//    	visited[s]=true;
//    	while(!queue.isEmpty()){
//    		int num=queue.pop();
////    		System.out.println(ans.toString());
//    		for(int i=0;i<adj[num].size();i++){
//    			if(!visited[adj[num].get(i)]){
//    				visited[adj[num].get(i)]=true;
//    				queue.add(adj[num].get(i));
//    			}
//    		}
//    	}
//    }
    static long gcd(long a,long b){
		if(a==0){
			return b;
		}
		return gcd(b%a,a);
	}
    static long power(long base, long exponent, long modulus){
	    long result = 1L;
	    while (exponent > 0) {
	        if (exponent % 2L == 1L)
	            result = (result * base) % modulus;
	        exponent = exponent >> 1;
	        base = (base * base) % modulus;
	    }
	    return result;
	}
    static HashMap<Long,Long> primeFactors(long n){
        HashMap<Long,Long> ans=new HashMap<Long,Long>();
    	// Print the number of 2s that divide n
        while (n%2L==0L)
        {
            if(ans.containsKey(2L)){
            	ans.put(2L,ans.get(2L)+1L);
            }else{
            	ans.put(2L,1L);
            }
            n /= 2L;
        }

        // n must be odd at this point.  So we can
        // skip one element (Note i = i +2)
        for (long i = 3; i <= Math.sqrt(n); i+= 2L)
        {
            // While i divides n, print i and divide n
            while (n%i == 0)
            {
            	if(ans.containsKey(i)){
                	ans.put(i,ans.get(i)+1L);
                }else{
                	ans.put(i,1L);
                }
                n /= i;
            }
        }

        // This condition is to handle the case whien
        // n is a prime number greater than 2
        if (n > 2)
            ans.put(n,1L);
        return ans;
    }
////for marking all prime numbers greater than 1 and less than equal to N
	static void sieve(int N) {
	 boolean isPrime[]=new boolean[N+1];
	 isPrime[0] = true;
	 isPrime[1] = true;
	 for(int i = 2; i * i <= N; ++i) {
	      if(isPrime[i] == false) {//Mark all the multiples of i as composite numbers
	          for(int j = i * i; j <= N ;j += i)
	              isPrime[j] = true;
	     }
	 }
	}
//  //if  str2 (pattern) is subsequence of str1 (Text) or not
//	static boolean function(String str1,String str2){
//	     str2 = str2.replace("", ".*");  //returns .*a.*n.*n.*a.
//	     return (str1.matches(str2));  // returns true
//	}
    static int Arr[];
    static long size[];
  //modified initialize function:
    static void initialize(int N){
    	Arr=new int[N];
    	size=new long[N];
        for(int i = 0;i<N;i++){
        	Arr[ i ] = i ;
        	size[ i ] = 1;
        }
    }
    static boolean find(int A,int B){
        if( root(A)==root(B) )       //if A and B have same root,means they are connected.
        return true;
        else
        return false;
    }
 // modified root function.
    static void weighted_union(int A,int B,int n){
        int root_A = root(A);
        int root_B = root(B);
        if(size[root_A] < size[root_B ]){
        	Arr[ root_A ] = Arr[root_B];
        	size[root_B] += size[root_A];
        }
        else{
        	Arr[ root_B ] = Arr[root_A];
        	size[root_A] += size[root_B];
        }
    }
    static int root (int i){
        while(Arr[ i ] != i){
            Arr[ i ] = Arr[ Arr[ i ] ] ;
            i = Arr[ i ];
        }
        return i;
    }

	static boolean isPrime(long n) {
		if(n < 2L) return false;
		if(n == 2L || n == 3L) return true;
		if(n%2L == 0 || n%3L == 0) return false;
		long sqrtN = (long)Math.sqrt(n)+1L;
		for(long i = 6L; i <= sqrtN; i += 6L) {
			if(n%(i-1) == 0 || n%(i+1) == 0) return false;
		}
		return true;
	}
//	static HashMap<Integer,Integer> level;;
//	static HashMap<Integer,Integer> parent;
	static int maxlevel=0;

//	static boolean T[][][];
//	static void subsetSum(int input[], int total, int count) {
//        T = new boolean[input.length + 1][total + 1][count+1];
//        for (int i = 0; i <= input.length; i++) {
//        	T[i][0][0] = true;
//        	for(int j = 1; j<=count; j++){
//        		T[i][0][j] = false;
//        	}
//        }
//        int sum[]=new int[input.length+1];
//        for(int i=1;i<=input.length;i++){
//            sum[i]=sum[i-1]+input[i-1];
//        }
//        for (int i = 1; i <= input.length; i++) {
//            for (int j = 1; j <= (int)Math.min(total,sum[i]); j++) {
//            	for (int k = 1; k <= (int)Math.min(i,count); k++){
//            		 if (j >= input[i - 1]) {//Exclude and Include
//                         T[i][j][k] = T[i - 1][j][k] || T[i - 1][j - input[i - 1]][k-1];
//                     } else {
//                         T[i][j][k] = T[i-1][j][k];
//                     }
//            	}
//            }
//        }
//    }
//	static <K,V extends Comparable<? super V>>
//	SortedSet<Map.Entry<K,V>> entriesSortedByValues(Map<K,V> map) {
//	    SortedSet<Map.Entry<K,V>> sortedEntries = new TreeSet<Map.Entry<K,V>>(
//	        new Comparator<Map.Entry<K,V>>() {
//	            @Override public int compare(Map.Entry<K,V> e1, Map.Entry<K,V> e2) {
//	                int res = e2.getValue().compareTo(e1.getValue());
//	                return res != 0 ? res : 1;
//	            }
//	        }
//	    );
//	    sortedEntries.addAll(map.entrySet());
//	    return sortedEntries;
//	}

	//minimum prime factor of all the numbers less than n
    static int minPrime[];
	static void minimumPrime(int n){
		minPrime=new int[n+1];
		minPrime[1]=1;
        for (int i = 2; i * i <= n; ++i) {
            if (minPrime[i] == 0) {         //If i is prime
                for (int j = i * i; j <= n; j += i) {
                    if (minPrime[j] == 0) {
                        minPrime[j] = i;
                    }
                }
            }
        }
        for (int i = 2; i <= n; ++i) {
            if (minPrime[i] == 0) {
                minPrime[i] = i;
            }
        }
	}
	static long modInverse(long A, long M)
	{
		long x=extendedEuclid(A,M)[0];
		return (x%M+M)%M;    //x may be negative
	}
	static long[] extendedEuclid(long A, long B) {
		if(B == 0) {
			long d = A;
			long x = 1;
			long y = 0;
			return new long[]{x,y,d};
		}
		else {
			long arr[]=extendedEuclid(B, A%B);
			long temp = arr[0];
			arr[0] = arr[1];
			arr[1] = temp - (A/B)*arr[1];
			return arr;
		}
	}

	static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
	}
}

import java.util.*;
import java.lang.*;
import java.io.*;
import java.awt.Point;

// SHIVAM GUPTA :
//NSIT
//decoder_1671
//BEING PERFECTIONIST IS NOT AN OPTION.
// STOP NOT TILL IT IS DONE OR U DIE .
//EITHER MAKE IT OR BREAK IT.
//NEVER UNDERESTIMATE URSELF.
// U KNOW THAT IF THIS DAY WILL BE URS THEN NO ONE CAN DEFEAT U
// REST ..HAVE FAITH ON DESTINY

// ASCII = 48 + i ;

// 2^28 = 268,435,456  > 10^8

// log 10 base 2 = 3.3219

// odd:: (x^2+1)/2 , (x^2-1)/2 ; x>=3

// even:: (x^2/4)+1 ,(x^2/4)-1  x >=4

/* Name of the class has to be "Main" only if the class is public. */

public class Main
{

    // static int[] arr = new int[100002] ;
    // static int[] dp = new int[100002] ;

    static PrintWriter out;

	static class FastReader{
		BufferedReader br;
		StringTokenizer st;
		public FastReader(){
			br=new BufferedReader(new InputStreamReader(System.in));
			out=new PrintWriter(System.out);
		}
		String next(){
			while(st==null || !st.hasMoreElements()){
				try{
					st= new StringTokenizer(br.readLine());
				}
				catch (IOException e){
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		long nextLong(){
			return Long.parseLong(next());
		}
		double nextDouble(){
			return Double.parseDouble(next());
		}
		String nextLine(){
			String str = "";
			try{
				str=br.readLine();
			}
			catch(IOException e){
				e.printStackTrace();
			}
			return str;
		}
	}

/////////////////////////////////////////////////////////////////////////////////////

public static int  min(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[0];

}

 /////////////////////////////////////////////////////////////////////////////

public static int  max(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[3];

}

///////////////////////////////////////////////////////////////////////////////////
static int sieve =  1000000 ;

static boolean[] prime =  new boolean[sieve + 1] ;

public static void sieveOfEratosthenes()
    {
        // FALSE == prime

        // TRUE ==  COMPOSITE

        // FALSE== 1

        // time complexity = 0(NlogLogN)== o(N)

        // gives prime nos bw 1 to N

        for(int i = 2; i<= sieve ; i++)
        {
            prime[i] = true  ;
            i++ ;
        }

        for(int p = 3; p*p <= sieve; p++)
        {

            if(prime[p] == false)
            {

                for(int i = p*p; i <= sieve; i += p)
                    prime[i] = true;
            }

            p++ ;
        }

    }

///////////////////////////////////////////////////////////////////////////////////

public static String reverse(String input)
{
    String op = "" ;

    for(int i = 0; i < input.length() ; i++ )
    {
        op = input.charAt(i)+  op ;
    }

return op ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static void sortD(int[] arr , int s  , int e)
{
      sort(arr ,s , e) ;

      int i =s ; int j = e  ;

      while( i < j)
      {
            int temp = arr[i] ;
            arr[i] =arr[j] ;
            arr[j] = temp ;
            i++ ; j-- ;
      }

      return ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(long a  ,long b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(int a  ,int b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

////////////////////////////////////////////////////////////////////////////////////

public static boolean isPossibleTriangle(int a  ,int b , int c)
{
      if( a + b > c && c+b > a && a +c > b)
      {
            return true  ;
      }

      return false  ;

}

/////////////////////////////////////////////////////////////////////////////////

public static long countSubarraysSumToK(long[] arr ,long sum )
    {
      HashMap<Long,Long> map = new HashMap<>() ;

      int n = arr.length ;

      long prefixsum = 0 ;

      long count = 0L ;
      for(int i  = 0; i < n ; i++)
      {
          prefixsum  = prefixsum +  arr[i] ;

          if(sum == prefixsum)count = count+1 ;

          if(map.containsKey(prefixsum -sum))
          {
              count = count + map.get(prefixsum -sum) ;
          }

          if(map.containsKey(prefixsum ))
          {
              map.put(prefixsum , map.get(prefixsum) +1 );
          }

          else{
              map.put(prefixsum , 1L );
          }

      }

      return count  ;

    }

///////////////////////////////////////////////////////////////////////////////////////

public static int gcd(int a, int b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

//////////////////////////////////////////////////////////////////////////////////
public static long gcd(long a, long b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c , int d )
{

int temp = lcm(a,b , c) ;

 int ans = lcm(temp ,d ) ;

return ans  ;

}

//////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c )
{

int temp = lcm(a,b) ;

int ans =  lcm(temp ,c) ;

return ans  ;

}

////////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a , int b )
{

int gc = gcd(a,b);

return (a*b)/gc ;

}

///////////////////////////////////////////////////////////////////////////////////

    // CALCULATE TOTIENT Fn FOR ALL VALUES FROM 1 TO n
    // TOTIENT(N) = count of nos less than n and grater than 1 whose gcd with n is 1
    // or n and the no  will be coprime in nature
    //time : O(n*(log(logn)))

    public static void eulerTotientFunction(int[] arr ,int n )
    {

      for(int i = 1; i <= n  ;i++)arr[i] =i  ;

      for(int i= 2 ; i<= n ;i++)
      {
          if(arr[i] == i)
          {
              arr[i] =i-1 ;

              for(int j =2*i ; j<= n  ; j+= i )
              {
                  arr[j] = (arr[j]*(i-1))/i ;
              }

          }
      }

      return  ;

    }

/////////////////////////////////////////////////////////////////////////////////////////////

static boolean isPrime(int n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(int i = 2; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}

static boolean isPrime(long n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(long i = 2L; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}
//////////////////////////////////////////////////////////////////////////////////////////
public static long nCr(int n,int k)
{
    long ans=1;
    k=k>n-k?n-k:k;
    int j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
///////////////////////////////////////////////////////////////////////////////////////////

public static ArrayList<Integer> allFactors(int n)
{
      ArrayList<Integer> list = new ArrayList<>() ;

    for(int i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

///////////////////////////////////////////////////////////////////////////

public static ArrayList<Long> allFactors(long n)
{
      ArrayList<Long> list = new ArrayList<>() ;

    for(long i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

/////////////////////////////////////////////////////////////////////////////

public static boolean isPowerOfTwo(int n)
{
    if(n==0)
    return false;

if(((n ) & (n-1)) == 0 ) return true ;
else return false  ;

}

////////////////////////////////////////////////////////////////////////////////////

    public static int countDigit(long n)
    {
        return (int)Math.floor(Math.log10(n) + 1);
    }

 /////////////////////////////////////////////////////////////////////////////////////////

 public static int sumOfDigits(long n)
 {

  if( n< 0)return -1 ;

  int sum = 0;

  while( n > 0)
  {
      sum = sum + (int)( n %10) ;

      n /= 10 ;
  }

  return sum ;

 }
 /////////////////////////////////////////////////////////////////////////////////////////

  static final int MAXN = 100001;

    static int spf[] = new int[MAXN];

    static void sieve()
    {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)

            spf[i] = i;

        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;

        for (int i=3; i*i<MAXN; i++)
        {

            if (spf[i] == i)
            {

                for (int j=i*i; j<MAXN; j+=i)

                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }

// The above code works well for n upto the order of 10^7.
// Beyond this we will face memory issues.

// Time Complexity: The precomputation for smallest prime factor is done in O(n log log n)
// using sieve.
// Where as in the calculation step we are dividing the number every time by
// the smallest prime number till it becomes 1.
// So, let’s consider a worst case in which every time the SPF is 2 .
// Therefore will have log n division steps.

// Hence, We can say that our Time Complexity will be O(log n) in worst case.

    static Vector<Integer> getFactorization(int x)
    {
        Vector<Integer> ret = new Vector<>();
        while (x != 1)
        {
            ret.add(spf[x]);
            x = x / spf[x];
        }
        return ret;
    }

  //////////////////////////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////////////////////////

public static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int[n1];
        int R[] = new int[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
  public static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
public static void sort(long arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

public static void merge(long arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        long L[] = new long[n1];
        long R[] = new long[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

 /////////////////////////////////////////////////////////////////////////////////////////

	public static long knapsack(int[] weight,long value[],int maxWeight){

        int n=  value.length ;

	//dp[i] stores the profit with KnapSack capacity "i"
  long []dp = new long[maxWeight+1];

    //initially profit with 0 to W KnapSack capacity is 0
    Arrays.fill(dp, 0);

    // iterate through all items
    for(int i=0; i < n; i++)

        //traverse dp array from right to left
        for(int j = maxWeight; j >= weight[i]; j--)
            dp[j] = Math.max(dp[j] , value[i] + dp[j - weight[i]]);

    /*above line finds out maximum of dp[j](excluding ith element value)
    and val[i] + dp[j-wt[i]] (including ith element value and the
    profit with "KnapSack capacity - ith element weight") */
    return dp[maxWeight];
	}

///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////

// to return max sum of any subarray in given array
public static long kadanesAlgorithm(long[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}
/////////////////////////////////////////////////////////////////////////////////////////////
public static long kadanesAlgorithm(int[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}

///////////////////////////////////////////////////////////////////////////////////////

// Arrays.sort(arr, new Comparator<Pair>() {
// 			@Override
// 			public int compare(Pair first, Pa second) {
// 				if (first.getAge() != second.getAge()) {
// 					return first.getAge() - second.getAge();
// 				}
// 				return first.getName().compareTo(second.getName());
// 			}
// 		});

/////////////////////////////////////////////////////////////////////////////////////////

public static long binarySerachGreater(int[] arr , int start , int end , int val)
{

      // fing total no of elements strictly grater than val in sorted array arr

      if(start >  end)return  0 ; //Base case

      int mid = (start + end)/2  ;

      if(arr[mid] <=val)
      {
          return binarySerachGreater(arr,mid+1, end ,val) ;

      }
      else{

         return binarySerachGreater(arr,start , mid -1,val) + end-mid+1 ;

      }

}

//////////////////////////////////////////////////////////////////////////////////

//TO GENERATE ALL(DUPLICATE ALSO EXIST) PERMUTATIONS OF A STRING

//Function for swapping the characters at position I with character at position j
    public static String swapString(String a, int i, int j) {
        char[] b =a.toCharArray();
        char ch;
        ch = b[i];
        b[i] = b[j];
        b[j] = ch;
        return String.valueOf(b);
    }

//Function for generating different permutations of the string
    public static void generatePermutation(String str, int start, int end)
    {
        //Prints the permutations
        if (start == end-1)
            System.out.println(str);
        else
        {
            for (int i = start; i < end; i++)
            {
                //Swapping the string by fixing a character
                str = swapString(str,start,i);
                //Recursively calling function generatePermutation() for rest of the characters
                generatePermutation(str,start+1,end);
                //Backtracking and swapping the characters again.
                str = swapString(str,start,i);
            }
        }
    }

// JUST CALL generatePermutation( str,  start,  end) start :inclusive ,end : exclusive

////////////////////////////////////////////////////////////////////////////////////

public static long arraySum(int[] arr , int start , int end)
{
    long ans = 0 ;

    for(int i = start ; i <= end  ; i++)ans += arr[i] ;

    return ans  ;
}

/////////////////////////////////////////////////////////////////////////////////

public static int mod(int x)
{
      if(x <0)return -1*x ;
      else return x ;
}
public static long mod(long x)
{
      if(x <0)return -1*x ;
      else return x ;
}

////////////////////////////////////////////////////////////////////////////////

public static void swapArray(int[] arr , int start , int end)
{
    while(start < end)
    {
        int temp = arr[start] ;
        arr[start] = arr[end];
        arr[end] = temp;
        start++ ;end-- ;
    }
}

//////////////////////////////////////////////////////////////////////////////////

public static long factMod(long n, long mod) {
    if (n <= 1) return 1;
    long ans = 1;
    for (int i = 1; i <= n; i++) {
      ans = (ans * i) % mod;
    }
    return ans;
  }

/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
public static long power(int x  ,int n)
    {
        //time comp : o(logn)

        if(n==0)return 1 ;
        if(n==1)return x;

        long ans =1  ;

      while(n>0)
      {
          if(n % 2 ==1)
          {
              ans = ans *x ;
          }

          n /= 2 ;

          x =  x*x ;

      }

      return ans ;
    }

////////////////////////////////////////////////////////////////////////////////////////////////////
public static long powerMod(long x, long n, long mod) {
    //time comp : o(logn)

    if(n==0)return 1L ;
        if(n==1)return x;

    long ans = 1;
    while (n > 0) {
      if (n % 2 == 1) ans = (ans * x) % mod;
      x = (x * x) % mod;
      n /= 2;
    }
    return ans;
  }

//////////////////////////////////////////////////////////////////////////////////

public static int[][] rotate(int[][] input){

int n =input.length;
int m = input[0].length ;
int[][] output = new int [m][n];

for (int i=0; i<n; i++)
	for (int j=0;j<m; j++)
		output [j][n-1-i] = input[i][j];
return output;
}

//////////////////////////////////////////////////////////////////////////////////

/*
lowerBound - finds largest element equal or less than value paased
upperBound - finds smallest element equal or more than value passed

if not present return -1;

*/

public static long lowerBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static int lowerBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static long upperBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

	public static int upperBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

/////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////

public static void solve()
{
FastReader scn = new FastReader() ;

//ArrayList<Integer> list = new ArrayList<>() ;
ArrayList<Long> list = new ArrayList<>() ;
ArrayList<Integer> lista = new ArrayList<>() ;
ArrayList<Integer> listb = new ArrayList<>() ;

//HashMap<Integer,Integer> map = new HashMap<>() ;
HashMap<Long,Integer> map = new HashMap<>() ;
HashMap<Integer,Integer> map1  = new HashMap<>() ;
HashMap<Integer,Integer> map2  = new HashMap<>() ;
//HashMap<Point,> point = new HashMap<>() ;

//int[] store = {2 ,3, 5 , 7  ,11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 } ;

// product of first 11 prime nos is gre ater than 10 ^ 12;

//HashMap<String,Integer> maps = new HashMap<>() ;
//HashMap<Integer,Boolean> mapb = new HashMap<>() ;

//if(map.containsKey(arr[i]))map.put(arr[i] , map.get(arr[i]) +1 ) ;
//else map.put(arr[i],1) ;

// if(map.containsKey(temp))map.put(temp , map.get(temp) +1 ) ;
// else map.put(temp,1) ;

Set<Integer> set = new HashSet<>() ;
//Set<Integer> sety = new HashSet<>() ;

int t = 1;
// t = scn.nextInt() ;

while(t-- > 0)
{

 //String str  = scn.next() ;
 //long n = scn.nextLong() ;
  //long k = scn.nextLong() ;

 //int n = scn.nextInt() ;
 //int m = scn.nextInt() ;
//int k = scn.nextInt() ;
// int x  = scn.nextInt() ;
// int y = scn.nextInt() ;
 //int a = scn.nextInt() ;
//long a = scn.nextLong() ;
 //int b = scn.nextInt() ;
//long b = scn.nextLong() ;
 //int c = scn.nextInt() ;
// int d = scn.nextInt() ;

long n = scn.nextLong() ;

long k = scn.nextLong() ;

long ans = n ;

long start =1L ;
long end = (1L<<n) -1L;

while(start <= end)
{
    long mid  =(start +end)/2L ;

    if(mid == k)
    {
      break ;
    }

    else if( mid > k)
    {

        end = mid-1 ;
         ans-- ;

    }

    else{

        start = mid+1;
        ans-- ;

    }

}

out.println(ans) ;

//for(int i = 0; i < n; i++)out.print(arr[i]+ " ") ;

//out.println() ;

list.clear() ;
map.clear() ;
map1.clear() ;
map2.clear() ;
set.clear() ;
} // test case  end loop

out.flush() ;
}

public static void main (String[] args) throws java.lang.Exception
{

solve() ;

}

}

 class Pair
{
  int first ;

  int second  ;

@Override
	public String toString() {

	String ans = "" ;
	ans  += this.first ;
	ans += " ";
	ans += this.second ;

	return ans  ;
	}

}

import java.io.*;
import java.util.*;
public class Main
{

	private void solve()throws IOException
	{
		int n=nextInt();
		long k=nextLong();
		int ans=n;
		long length=(1l<<n)-1;
		while(true)
		{
			long mid=(length+1)/2;
			if(k==mid)
				break;
			else if(k>mid)
				k=k-mid;
			ans--;
			length=(length-1)/2;
		}
		out.println(ans);
	}

	///////////////////////////////////////////////////////////

	public void run()throws IOException
	{
		br=new BufferedReader(new InputStreamReader(System.in));
		st=null;
		out=new PrintWriter(System.out);

		solve();

		br.close();
		out.close();
	}
	public static void main(String args[])throws IOException{
		new Main().run();
	}
	BufferedReader br;
	StringTokenizer st;
	PrintWriter out;
	String nextToken()throws IOException{
		while(st==null || !st.hasMoreTokens())
		st=new StringTokenizer(br.readLine());
		return st.nextToken();
	}
	String nextLine()throws IOException{
		return br.readLine();
	}
	int nextInt()throws IOException{
		return Integer.parseInt(nextToken());
	}
	long nextLong()throws IOException{
		return Long.parseLong(nextToken());
	}
	double nextDouble()throws IOException{
		return Double.parseDouble(nextToken());
	}
}

import java.io.*;
import java.util.*;

public class NewClass {

    public static void main(String[] args) throws IOException{
       InputReader in = new InputReader(System.in);
        OutputWriter out = new OutputWriter(System.out);
        int n = in.nextInt();
        long k = in.nextLong();
       int re=0;
       while(k%2==0){
           re++;
           k/=2;
       }
      out.print(re+1);
      out.flush();
    }
    }

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}

import java.io.*;
import java.util.*;

public class NewClass {

    public static void main(String[] args)  {
        Scanner s = new Scanner(System.in);
        s.nextInt();
        long k = s.nextLong();
        int re=1;
        while (k%2==0) {
            re++;
            k/=2;
        }
        System.out.println(re);
    }
}

class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int read() {
        if (snumChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0) {
                return -1;
            }
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = read();
        while (isSpaceChar(c)) {
            c = read();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

}

class OutputWriter {

    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

    public void flush() {
        writer.flush();
    }

}

import java.util.*;
public class ChloeAndTheSequence {

    private static Scanner scan= new Scanner(System.in);

    public static void main(String [] args){
        int n= scan.nextInt();

        long x= scan.nextLong();
        int count = 1;
        while(count <= n){
            if(x % 2 == 1){
                System.out.println(count);
                break;
            }
            x /= 2;
            count++;
        }
    }
}

import java.util.*;
import java.io.*;

public final class Solution
{
    public static void main(String[] args)
    {
        Reader input = new Reader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = input.nextInt();
        long k = input.nextLong();
        if(k % 2 != 0)
        	out.println(1);
        else
        {
        	double log = Math.log10(k) / Math.log10(2);
        	if( log - (int)log < 0.0001)
        	{
        		out.println((int)log + 1);
        	}
        	else
        	{
        		for(int i = 1 ;i <= n ; i++)
        		{
        			long initial = (long)Math.pow(2, i);
        			long power = (long)Math.pow(2, i + 1);
        			if((k - initial) % power == 0)
        			{
        				out.println(i + 1);
        				break;
        			}
        		}
        	}
        }
        out.close();

    }
    public static class Reader
    {
    	BufferedReader br;
    	StringTokenizer st;
    	public Reader()
    	{
    		br = new BufferedReader(new InputStreamReader(System.in));
    	}
    	public String next()
    	{
    		try
    		{
        		if(st == null || !st.hasMoreTokens())
        			st = new StringTokenizer(br.readLine());
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return st.nextToken();
    	}
    	public int nextInt()
    	{
    		return Integer.parseInt(next());
    	}
    	public double nextDouble()
    	{
    		return Double.parseDouble(next());
    	}
    	public long nextLong()
    	{
    		return Long.parseLong(next());
    	}
    	public String nextLine()
    	{
    		try
    		{
    			return br.readLine();
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return "";
    	}
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HossamDoma
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();
            long k = in.nextLong();

            out.println(Long.numberOfTrailingZeros(Long.lowestOneBit(k)) + 1);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public Long nextLong() {
            return Long.parseLong(next());
        }

    }
}

//package codeforces.div2;

import java.util.*;

public class ChloeAndTheSequence {

    static public void print(int n, long k) {

        if(k%2!=0) {
            System.out.println(1);
        } else {
            int pow = 1;
            int count = 2;
            for(long i = 2; i<=k;) {
                if((k-i)%(i*2) == 0) {
                    System.out.println(count);
                    break;
                }
                pow++;
                count++;
                i = (long)(Math.pow(2, pow));
            }
        }
        //System.out.println(sb.toString().charAt(k-1));
    }
    public static void main(String []args) {

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long k = sc.nextLong();
        print(n, k);
    }
}

import java.io.*;
public class Chloeandthesequence {

	public static void main(String[] args) throws IOException{
			BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
			String [] l = b.readLine().split(" ");
			long x = Integer.parseInt(l[0]);
			long y =  Long.parseLong(l[1]);
			long s = 1;
			for(int i = 1 ; i < x;i++)
			 s = s*2+1;
			long m =1;
			long lo = 1;
			long hi = s;
			long target= x;
			//System.out.println(s);
			while(lo<hi){

				m = (lo+hi)/2;
				if(y<m){
					hi = m-1;
					target--;
				}else if(y>m){
					lo = m+1;
					target--;
				}else{
				 break;
				}
				//System.out.println(target+" "+y+" "+m);
			}
			System.out.println(target);

	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author rishus23
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        static long y;
        static long k;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            long h = 1L;
            k = in.nextLong();
            long x = (h << n) - 1;
            y = x;
            int v = s(x, n);
            out.print(v);
        }

        private int s(long x, int n) {
            //System.out.println(x+" "+n+" "+((x>>1) + 1));
            long t = (x >> 1L) + 1L;
            long b = k - t;
            if (b % (1L << n) == 0)
                return n;
            else
                return s(x >> 1L, n - 1);

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

    }
}

import java.util.ArrayList;
import java.util.Scanner;

public class chloeAndTheSequence743B {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),k=in.nextLong();
		while(n>0) {
			long siz=(long) (Math.pow(2, n)-1);
//			System.out.println("n:"+n+" k:"+k+" siz:"+((siz/2)+1));
			if(k==(siz/2)+1) {
				System.out.println(n);
				break;
			}
			else if(k<(siz/2)+1) {
				n--;
			}
			else {
				n--;
				k-=(siz/2)+1;
			}
		}

	}
}

import java.util.Scanner;

public class OneProject {
	public static void solve384A() {
		int n, a, b;
		Scanner in = new Scanner(System.in);
		n = in.nextInt(); a = in.nextInt() - 1; b = in.nextInt() - 1;
		in.nextLine();
		char[] s = new char[n];
		s = (in.nextLine()).toCharArray();
		if (s[a] == s[b]) {
			System.out.print(0);
		} else {
			System.out.print(1);
		}
	}
	public static void solve384C() {
		int n;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		if (n == 1) System.out.print(-1);
		else System.out.printf("%d %d %d", n, n + 1, n * (n + 1));
	}

//	This recursive function is too slow
//	public static void func384B(int s, int[] input, int begin, int end) {
//		if (s == 1) input[begin] = 1;
//		else {
//			int mid = begin + (end - begin) / 2;
//			input[mid] = s;
//			func384B(s - 1, input, begin, mid - 1);
//			func384B(s - 1, input, mid + 1, end);
//		}
//	}
//	public static void func384B(int s, int[] input) {
//		func384B(s, input, 0, input.length - 1);
//	}
	public static void solve384B() {
		int n; long i;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		i = in.nextLong();
		long begin = 1, end = 1;
		for (int j = 1; j != n; ++j) {
			end = end * 2 + 1;
		}
		while (n > 0) {
			long mid = begin + (end - begin) / 2;
			if (i == mid) {
				System.out.print(n);
				break;
			}
			else if (i < mid) {
				end = mid - 1;
				n--;
			}
			else {
				begin = mid + 1;
				n--;
			}
		}
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		solve384B();
	}
}

import java.util.*;

public class B743 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner scan=new Scanner(System.in);

		int n=scan.nextInt();
		long k=scan.nextLong();

		long i;
		double f;
		i=k;
		f=k;

		int c=0;

		while(i==f){
			f/=2.0;
			i/=2;

			c++;
		}

	System.out.println(c);

	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author llamaoo7
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BChloeAndTheSequence solver = new BChloeAndTheSequence();
        solver.solve(1, in, out);
        out.close();
    }

    static class BChloeAndTheSequence {
        long f(long n, long k) {
            long m = 1L << (n - 1);
            if (k == m) {
                return n;
            }
            return f(n - 1, k - (k > m ? m : 0));
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong();
            long k = in.nextLong();
            out.println(f(n, k));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.util.*;
import java.lang.*;

public class MyClass {
    public static void main(String args[]) {
        Scanner in=new Scanner(System.in);
        int n;
        long k;
        n=in.nextInt();
        k=in.nextLong();
        while(true){
            if(k==Math.pow(2,n-1)){
                System.out.print(n);
                break;
            }
            else if(k>Math.pow(2,n-1)){
                n-=1;
                k-=Math.pow(2,n);
            }
            else n-=1;
        }
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class B {
	public static void main(String[] args) throws IOException {
		PrintWriter out = new PrintWriter(System.out);
		FastScanner in = new FastScanner(System.in);
		int n= in.nextInt();
		long k= in.nextLong();
		long res= Long.lowestOneBit(k);
		long s=2;
		for (int i = 0; i <= 64; i++) {
			if(Math.pow(s, i)==res){
				System.out.println(i+1);
				break;
			}
		}
	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
			st = new StringTokenizer("");
		}

		public String next() throws IOException {
			if (!st.hasMoreTokens()) {
				st = new StringTokenizer(br.readLine());
				return next();
			}
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B {
	public static void main(String[] args) throws IOException{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String[] ns = bf.readLine().split(" ");
		int n = Integer.parseInt(ns[0]);
		long k = Long.parseLong(ns[1]);
		long length = 1;
		for(int i = 1;i<=n;i++){
			if(k<=length){
				for(i=i;true;i--){
					if(k==(length+1)/2){
						System.out.println(i);
						return;
					}
					else{
						long diff = length-k;
						length = (length-1)/2;
						if(k>length)
							k = length-diff;
					}
				}
			}

			length = 2*length+1;
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task10 solver = new Task10();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task10 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextLong();
            long sz = 1;
            for (int i = 1; i < n; i++) {
                sz = 2 * sz + 1;
            }
            out.println(search(1, sz, k, n));
        }

        public long search(long l, long r, long k, long n) {
            long mid = l + (r - l) / 2;
            if (mid == k)
                return n;
            else {
                if (mid > k)
                    return search(l, mid - 1, k, n - 1);
                else
                    return search(mid + 1, r, k, n - 1);
            }
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;

public class a {
	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[64]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}
			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}

	// User Defined Method start
	public static int inputInt() throws IOException {
		return sc.nextInt();
	}

	public static long inputLong() throws IOException {
		return sc.nextLong();
	}

	public static double inputDouble() throws IOException {
		return sc.nextDouble();
	}

	public static String inputString() throws IOException {
		return sc.readLine();
	}

	public static void print(String a) throws IOException {
		bw.write(a);
	}

	public static void printSp(String a) throws IOException {
		bw.write(a + " ");
	}

	public static void println(String a) throws IOException {
		bw.write(a + "\n");
	}
	// User Defined Method End

	// Helper Function - start
	private static void printArray(Integer arr[]) {
		for (int i : arr)
			System.out.print(i + " ");
		System.out.println();
	}

	private static void inputArray(int arr[]) throws IOException {
		for (int i = 0; i < arr.length; i++) {
			arr[i] = s1.nextInt();
		}
	}

	// helper Function - End

	// Defining input and output stream obj - Start
	static Reader sc = new Reader();
	static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static Scanner s1 = new Scanner(System.in);

	public static void main(String[] args) throws Exception {
		int n = s1.nextInt();
		long k = s1.nextLong();

		long limit = 1;
		for(int i=1;i<n;i++)
			limit = (limit*2L) + 1L;

		System.out.println(go(1,limit,k,n));
	}

	public static long go(long l,long r,long find,long alp)
	{
		long mid = l + (r-l)/2;

		if(find > mid)
			return go(mid+1L,r,find,alp-1L);
		else if(find < mid)
			return go(l,mid-1L,find,alp-1L);
		else
			return alp;
	}
}

import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

    public static void main(String[] args) {
        FastReader f = new FastReader();

       long n = f.nextInt();
       long k = f.nextLong();

       long minus = 1;
       long mod = 2;
        int ans = 1;
       while (true) {
           long loc = k - minus;
           if(loc % mod == 0) {
               System.out.println(ans);
               return;
           }

           minus = minus << 1;
           mod = mod << 1;
           ans++;
       }

    }

    //fast input reader
    static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.util.*;
import java.io.*;

public class powers{
    public static long seqlength(int n){
        return (1L<<n) - 1;
    }
    public static long ans(int n, long k){
        if(n==1) return 1;
        long len = seqlength(n);
        if(k == (seqlength(n)+1)/2) return n;
        if(k < (seqlength(n)+1)/2) return ans(n-1, k);
        else{ // k > (seqlength+1)/2
            return ans(n-1, k - seqlength(n-1) - 1);
        }

    }

	public static void main(String args[]){
		Scanner in = new Scanner(System.in);
	    int n = in.nextInt();
	    long k = in.nextLong();
	    System.out.println(ans(n,k));
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class MainB {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		long idx = Long.parseLong(st.nextToken());
		long [] intervals = new long[n + 1];
		long [] startPoints = new long[n + 1];
		for(int i = 1; i <= n; i++) {
			intervals[i] = intervals[i - 1] * 2 + 1;
		}
		for(int i = 1; i <= n; i++) {
			startPoints[i] = ++intervals[i]/2;
			if(idx >= startPoints[i]) {
				if((idx - startPoints[i]) % intervals[i] == 0) {
					System.out.println(i);
					return;
				}
			}
		}
	}
}

import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Codeforces{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		long k=sc.nextLong();
		if(k%2!=0) System.out.println("1");
		else {
			for(int i=n-1;i>=1;i--) {
				if(k%Math.pow(2,i)==0) {
					System.out.println(i+1);
					break;
				}
			}
		}
	}
}

import java.util.ArrayList;
import java.util.InputMismatchException;

import java.io.IOException;
import java.io.PrintWriter;

public class B_384 {

	/**************Scanner********************/
	static class FastReader {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int snumChars;

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}

	/************main*************/
	public static void main(String args[]) {

		FastReader scan = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		/*******************code***********************/
		long n=scan.nextLong();
		long k=scan.nextLong();
		if(k%2==1)
		{
			out.println(1);
		}
		else
		{
			long l=0;
			long r=(long) Math.pow(2, n);
			int a=0;
			long mid=0;
			//out.println(mid+"   md   ");
			while(true)
			{
				mid=(l+r)/2;
				//out.println(mid);
				if(k>mid)
				{
					l=mid;
					//out.println(" 1 ");
					a++;
				}
				else if(k<mid)
				{
					r=mid;
					//out.println(" 2 ");
					a++;
				}
				else
				{
					out.println(n-a);
					//out.println("here "+a);
					break;
				}
			}
		}
		out.close();
	}
}

import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class B384{

	void solve()
	{
		int n = ni();
		long k = nl();
		int cn = 1;
		while(k!=0)
		{
			if((k&1)==1)
			{
				System.out.print(cn+" ");
				break;
			}
			else
			{
				cn++;
				k>>=1;
			}
		}
	}

	public static void main(String[] args){new B384().solve();}

	private byte[] bufferArray = new byte[1024];
	private int bufLength = 0;
	private int bufCurrent = 0;
	InputStream inputStream = System.in;

	int nextByte()
	{
		if(bufLength==-1)
			throw new InputMismatchException();
		if(bufCurrent>=bufLength)
		{
			bufCurrent = 0;
			try
			{bufLength = inputStream.read(bufferArray);}
			catch(IOException e)
			{ throw new InputMismatchException();}
			if(bufLength<=0)
				return -1;
		}
		return bufferArray[bufCurrent++];
	}

	boolean isSpaceChar(int x)
	{return (x<33 || x>126);}

	boolean isDigit(int x)
	{return (x>='0' && x<='9');}

	int nextNonSpace()
	{
		int x;
		while((x=nextByte())!=-1 && isSpaceChar(x));
		return x;
	}

	int ni()
	{
		int ans = 0;
		int sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	long nl()
	{
		long ans = 0;
		long sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	String ns()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(!isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	String nL()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(x==32 || !isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	char nc()
	{ return (char)nextNonSpace();}

	double nd()
	{ return (double)Double.parseDouble(ns()); }

	char[] ca()
	{ return ns().toCharArray();}

	char[] ca(int n)
	{
		char[] ans = new char[n];
		int p =0;
		int x = nextNonSpace();
		while(p<n)
		{
			ans[p++] = (char)x;
			x = nextByte();
		}
		return ans;
	}

	int[] ia(int n)
	{
		int[] ans = new int[n];
		for(int i=0;i<n;i++)
			ans[i]=ni();
		return ans;
	}

	long[] la(int n)
	{
		long[] ans = new long[n];
		for(int i=0;i<n;i++)
			ans[i] = nl();
		return ans;
	}

}

import java.io.*;
import java.util.*;

public class Stack {
    public static void main(String[] args) throws IOException {
        BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(r.readLine());
        int n=Integer.parseInt(in.nextToken());
        long k=Long.parseLong(in.nextToken());

        long ns[]=new long [n+2];
        for(int i=0;i<n+2;i++){
            ns[i]=(long)Math.pow(2, i)-1;
        }
        long last=ns[n+1];

        System.out.println(bs(last,k,n)+1);

    }
    public static int bs(long l,long key,int c){
        long f=1,m;
        while(f<=l){
            m=(f+l)/2;
            if(m==key)return c;
            else if(m>key)l=m-1;
            else f=m+1;
            c--;
        }
        return -10000;
    }

    public static void sort(int []a){
        int temp;
        for(int i=a.length;i>=0;i--){
            for(int j=0;j<a.length-1;j++){
                if(a[j]<a[j+1]){
                   temp=a[j];
                   a[j]=a[j+1];
                   a[j+1]=temp;
                }
            }
        }
    }
    public static void dis(long a[]){
        for(int i=0;i<a.length;i++){
            System.out.print(a[i]+" ");
        }
        System.out.println("");
    }

}

import java.io.*;
public class Chloeandthesequence {

	public static void main(String[] args) throws IOException{
			BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
			String [] l = b.readLine().split(" ");
			long x = Integer.parseInt(l[0]);
			long y =  Long.parseLong(l[1]);
			long s = 1;
			for(int i = 1 ; i < x;i++)
			 s = s*2+1;
			long m =1;
			long lo = 1;
			long hi = s;
			long target= x;
			//System.out.println(s);
			while(lo<hi){

				m = (lo+hi)/2;
				if(y<m){
					hi = m-1;
					target--;
				}else if(y>m){
					lo = m+1;
					target--;
				}else{
				 break;
				}
				//System.out.println(target+" "+y+" "+m);
			}
			System.out.println(target);

	}

}

import java.util.*;
import java.math.*;
import java.io.*;

public class Cheker{
	public static InputReader sc;
    public static PrintWriter out;
    public static final int MOD = (int) (1e9 + 7);
    public static void main(String[] args){
    	sc=new InputReader(System.in);
    	out=new PrintWriter(System.out);
    	int n=sc.nextInt();
    	long k=sc.nextLong();
    	if(k%2==1){
    		out.println(1);
    	}
    	else{
    		long gp=((long)Math.pow(2, n)-1);
    		int middleVal=n;
    		long l=1;
    		long r=gp;
    		long middle=(l+r)/2;
    		while(k!=middle){
    			if(k<middle){
    				r=middle-1;
    				middleVal-=1;
    			}
    			else{
    				middleVal-=1;
    				l=middle+1;
    			}
    			middle=(l+r)/2;
    		}
    		out.println(middleVal);
    	}
    	out.close();
    }

    static void shuffle(int[] A){
    	for(int i=A.length-1;i>0;i--){
    		int j=(int)(Math.random()*(i+1));
    		int temp=A[j];
    		A[j]=A[i];
    		A[i]=temp;
    	}
    }

	public static class Node implements Comparable<Node>{
	    int next;
	    long dist;

	    public Node (int u, int v) {
	        this.next = u;
	        this.dist = v;
	    }

	    public void print() {
	        out.println(next + " " + dist + " ");
	    }

	    public int compareTo(Node n) {
	        return Integer.compare(-this.next, -n.next);
	    }
	}

	public static BigInteger pow(BigInteger base, BigInteger exp) {
	    if(exp.equals(new BigInteger(String.valueOf(0)))){
	        return new BigInteger(String.valueOf(1));
	    }
	    if(exp.equals(new BigInteger(String.valueOf(1))))
	        return base;
	    BigInteger temp=exp.divide(new BigInteger(String.valueOf(2)));
	    BigInteger val = pow(base, temp);
	    BigInteger result = val.multiply(val);
	    result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    BigInteger AND=exp.and(new BigInteger(String.valueOf(1)));
	    if(AND.equals(new BigInteger(String.valueOf(1)))){
	        result = result.multiply(base);
	        result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    }
	    return result;
	}

	static class InputReader {

	    private InputStream stream;
	    private byte[] buf = new byte[8192];
	    private int curChar, snumChars;
	    private SpaceCharFilter filter;

	    public InputReader(InputStream stream) {
	        this.stream = stream;
	    }

	    public int snext() {
	        if (snumChars == -1)
	            throw new InputMismatchException();
	        if (curChar >= snumChars) {
	            curChar = 0;
	            try {
	                snumChars = stream.read(buf);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	            if (snumChars <= 0)
	                return -1;
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        int res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        long res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public int[] nextIntArray(int n) {
	        int a[] = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public String readString() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        StringBuilder res = new StringBuilder();
	        do {
	            res.appendCodePoint(c);
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    public boolean isSpaceChar(int c) {
	        if (filter != null)
	            return filter.isSpaceChar(c);
	        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }

	    public interface SpaceCharFilter {
	        public boolean isSpaceChar(int ch);
	    }
	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class A {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, InputReader in, PrintWriter out)
        {
        	int n=in.nextInt();
        	long k=in.nextLong();
        	int count=1;
        	while(k%2==0)
        	{
        		count++;
        		k/=2;
        	}
        	System.out.print(count);
        }

    }

    static long min2(long x,long y){return x<y?x:y;}
    static long min3(long x,long y,long z){return x<y?(x<z?x:z):(y<z?y:z);}
    static long min4(long n1,long n2,long n3,long n4){
    	return n1<n2?(n1<n3?(n1<n4?n1:n4):(n3<n4?n3:n4)):(n2<n3?(n2<n4?n2:n4):(n3<n4?n3:n4));}
    static long max2(long x,long y){return x>y?x:y;}
    static long max3(long x,long y,long z){return x>y?(x>z?x:z):(y>z?y:z);}
    static long max4(long n1,long n2,long n3,long n4){
    	return n1>n2?(n1>n3?(n1>n4?n1:n4):(n3>n4?n3:n4)):(n2>n3?(n2>n4?n2:n4):(n3>n4?n3:n4));}
    static int min2(int x,int y){return x<y?x:y;}
    static int min3(int x,int y,int z){return x<y?(x<z?x:z):(y<z?y:z);}
    static long min4(int n1,int n2,int n3,int n4){
    	return n1<n2?(n1<n3?(n1<n4?n1:n4):(n3<n4?n3:n4)):(n2<n3?(n2<n4?n2:n4):(n3<n4?n3:n4));}
    static int max2(int x,int y){return x>y?x:y;}
    static int max3(int x,int y,int z){return x>y?(x>z?x:z):(y>z?y:z);}
    static long max4(int n1,int n2,int n3,int n4){
    	return n1>n2?(n1>n3?(n1>n4?n1:n4):(n3>n4?n3:n4)):(n2>n3?(n2>n4?n2:n4):(n3>n4?n3:n4));}

    static long abs(long x){if(x<0) return -x; else return x;}
    static int abs(int x){if(x<0) return -x; else return x;}

    static long sumarr(int arr[],int n1,int n2){
    	long sum=0; for(int i=n1-1;i<n2;i++) sum=sum+arr[i];  return sum; }

//**************************************Reader Class*********************************************//

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
        	return Long.parseLong(next());
        }

        public double nextDouble() {
        	return Double.parseDouble(next());
        }

    }
}

import java.io.*;
import java.util.*;

public class Main {
	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer buffer;

	public static void solve() {
	    long n = nl(), k = nl()-1;
	    long len = (1L << n) - 1;

	    while (k != len/2) {
            if (k > len/2) k-=(len+1)/2;
            len = len/2;
            n--;
        }

        out.println(n);
	}

	public static void main(String[] args) throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	static String next() {
		while (buffer == null || !buffer.hasMoreElements()) {
			try {
				buffer = new StringTokenizer(in.readLine());
			} catch (IOException e) {
				//
			}
		}
		return buffer.nextToken();
	}

	static int ni() {
		return Integer.parseInt(next());
	}

	static long nl() {
		return Long.parseLong(next());
	}

	static double nd() {
		return Double.parseDouble(next());
	}

	static String ns() {
		return next();
	}

	static int[] ni(int n) {
		int[] res = new int[n];
		for (int i = 0; i < n; i++)
			res[i] = Integer.parseInt(next());
		return res;
	}

	static long[] nl(int n) {
		long[] res = new long[n];
		for (int i = 0; i < n; i++)
			res[i] = Long.parseLong(next());
		return res;
	}

	static double[] nd(int n) {
		double[] res = new double[n];
		for (int i = 0; i < n; i++)
			res[i] = Double.parseDouble(next());
		return res;
	}

	static String[] ns(int n) {
		String[] res = new String[n];
		for (int i = 0; i < n; i++)
			res[i] = next();
		return res;
	}

}

import java.io.*;

/**
 *
 */

/**
 * @author mohanad
 *
 */
public class Div2_743B {

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String line[] = bf.readLine().split(" ");
		int n = Integer.parseInt(line[0]);
		long k = Long.parseLong(line[1]);
		long coun = 3;
		if (k % 2 == 1)
			System.out.println(1);

		else if ((int) (Math.log(k) / Math.log(2)) - Math.log(k) / Math.log(2) == 0)
			System.out.println((int) (Math.log(k) / Math.log(2) + 1));

		else {

			for (int i = 1; i < n; ++i)
				coun = (coun * 2) + 1;

			System.out.println(bs(1l, coun, k, n + 1));

		}
	}

	public static int bs(long l, long r, long k, int curr) {

		long mid = (l + r) / 2;
		if (k > mid)
			return bs(mid + 1, r, k, curr - 1);
		else if (k < mid)
			return bs(l, mid - 1, k, curr - 1);

		return curr;
	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class c384b {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, InputReader in, PrintWriter out)
        {
        	int n=in.nextInt();
        	long k=in.nextLong();
        	int count=1;
        	while(k%2==0)
        	{
        		count++;
        		k/=2;
        	}
        	System.out.print(count);
        }

    }

    static long min2(long x,long y){return x<y?x:y;}
    static long min3(long x,long y,long z){return x<y?(x<z?x:z):(y<z?y:z);}
    static long min4(long n1,long n2,long n3,long n4){
    	return n1<n2?(n1<n3?(n1<n4?n1:n4):(n3<n4?n3:n4)):(n2<n3?(n2<n4?n2:n4):(n3<n4?n3:n4));}
    static long max2(long x,long y){return x>y?x:y;}
    static long max3(long x,long y,long z){return x>y?(x>z?x:z):(y>z?y:z);}
    static long max4(long n1,long n2,long n3,long n4){
    	return n1>n2?(n1>n3?(n1>n4?n1:n4):(n3>n4?n3:n4)):(n2>n3?(n2>n4?n2:n4):(n3>n4?n3:n4));}
    static int min2(int x,int y){return x<y?x:y;}
    static int max2(int x,int y){return x>y?x:y;}

    static long abs(long x)
    {
    	if(x<0)
    		return -x;
    	else
    		return x;
    }

    static int abs(int x)
    {
    	if(x<0)
    		return -x;
    	else
    		return x;
    }

    static long sumarr(int arr[],int n1,int n2)
    {
    	long sum=0;
    	for(int i=n1-1;i<n2;i++)
    	{
    		sum=sum+arr[i];
    	}
    	return sum;
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
        	return Long.parseLong(next());
        }

        public double nextDouble() {
        	return Double.parseDouble(next());
        }

    }
}

import java.util.ArrayList;
import java.util.Scanner;

public class chloeAndTheSequence743B {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner in = new Scanner(System.in);
		long n=in.nextLong(),k=in.nextLong();
		while(n>0) {
			long siz=(long) (Math.pow(2, n)-1);
//			System.out.println("n:"+n+" k:"+k+" siz:"+((siz/2)+1));
			if(k==(siz/2)+1) {
				System.out.println(n);
				break;
			}
			else if(k<(siz/2)+1) {
				n--;
			}
			else {
				n--;
				k-=(siz/2)+1;
			}
		}

	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HossamDoma
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();
            long k = in.nextLong();

            out.println(Long.numberOfTrailingZeros(Long.lowestOneBit(k)) + 1);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public Long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.io.*;
import java.util.*;

public class spoj
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next()
		{
			while(st==null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch(IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str="";
			try
			{
				str = br.readLine();
			}
			catch(IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String args[]) throws IOException
	{
		FastReader fr = new FastReader();
		long low=0L,high=1L,mid,m;
		long n = fr.nextLong();
		long k = fr.nextLong();
		k--;
		if(k==(Math.pow(2,n)-1)/2)
		{
			System.out.println(n);
		}
		else if(k%2==0)
		{
			System.out.println(1);
		}
		else
		{
			low = 0L;
			high = (long)Math.pow(2,n)-1;
			while(low<high)
			{
				mid  = (low+high)/2;
				if(k>mid)
				{
					low = mid + 1;
				}
				else if(k<mid)
				{
					high = mid;
				}
				else
				{
					break;
				}
				n--;
			}
			System.out.println(n);
		}

 	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HossamDoma
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        long k;

        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();
            k = in.nextLong();
            out.println(find(1, ((long) 1 << n) - 1, n));
        }

        private int find(long l, long r, int n) {

            long mid = (l + r) / 2;

            if (mid == k)
                return n;
            if (mid < k)
                return find(mid + 1, r, n - 1);
            else
                return find(l, mid - 1, n - 1);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public Long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.StringTokenizer;
import java.util.StringJoiner;
import java.util.stream.IntStream;

import java.io.PrintWriter;
//import java.util.Arrays;

public class A {

	public static FastScanner fs = new FastScanner();
	public static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {
		solve();
	}

	public static void solve(){
		int n = fs.nextInt(), index = 1;
		Long k = fs.nextLong();
		String S = Long.toBinaryString(k);
		for (int i = S.length()-1; i >= 0; i--){
			if (S.charAt(i) == '1'){
				break;
			}
			index ++;
		}
		out.println(index);
		out.flush();
	}

	static void array_space(int[] A){
		StringJoiner sj = new StringJoiner(" ");
		IntStream.of(A).forEach(x -> sj.add(String.valueOf(x)));
		System.out.println(sj.toString());
	}

	static void sort(int[] a) {
		ArrayList<Integer> l=new ArrayList<>();
		for (int i:a) l.add(i);
		Collections.sort(l);
		for (int i=0; i<a.length; i++) a[i]=l.get(i);
	}

	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
}

import java.util.*;

public class SequenceProblem2 {
	static int level;
	static long position;

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scan = new Scanner(System.in);

		level = scan.nextInt();
		position = scan.nextLong()-1;

		System.out.println(binarySearch(level,position));

	}

	public static long getMaxSize(int level){
		if(level == 1){
			return 1;
		}else{
			return getMaxSize(level-1)+((long)Math.pow(2, level-1));
		}
	}

	public static int binarySearch(int level, long pos){
		long maxsize = getMaxSize(level);
		int levelcounter = level;
		long low = 0;
		long high = maxsize-1;
		long mid = (high+low)/2;

		while(mid!=pos){
			if(mid<pos){
				low = mid+1;
			}else{
				high = mid-1;
			}
			mid = (low+high)/2;
			levelcounter--;
		}

		return levelcounter;
	}

}

import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static PrintWriter out;

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt(); // step number
        long k = sc.nextLong(); // ith digit

        if (n== 0 || n==1) {
            out.println(1);

        } else {

            long step = 2;
            long count = 3;
            while (step < (long) n) {
                count = (count * 2) + 1;
                step++;
            }

            long low = 1;
            long high = count;

            long middleVal = (long) n;
            while (low <= high) {
                //out.println("low: " + low + " high: " + high);
                long middle = (long) Math.ceil(((double) (high - low) / (double) 2) + (double) low);

                //out.println(middle);
                if (k < middle) {
                    high = middle - 1;
                    middleVal--;
                } else if (k > middle) {
                    low = middle + 1;
                    middleVal--;
                } else {
                    out.println(middleVal);
                    break;
                }
            }

        }
        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

import java.util.Scanner;

/**
 * Created by for on 2017-01-30.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        long k = sc.nextLong();

        long size = 1;
        for(int i = 1; i < n; i++) {
            size = size * 2 + 1;
        }

        long left = 1;
        long right = size;
        long m = -1;

        while(n > -1) {
            // 이진 탐색
            m = (left+right)/2;

            if(k < m) {
                right = m-1;
            } else if(k > m) {
                left = m+1;
            } else {
                System.out.println(n);
                break;
            }
            n--;
        }
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author P Marecki
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        int go(int n, long k) {
            if (n == 1) return 1;
            long mid = (1L << (n - 1)) - 1;
            if (k == mid) return n;
            if (k > mid) k -= mid + 1;
            return go(n - 1, k);
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextLong() - 1;
            out.println(go(n, k));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.util.*;
public class bitmask_cf384_2_2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong(),k=sc.nextLong(),count=0;
		while(n>0) {
			if(k%2 == 0) {
				k /= 2;
				count++;
			}
			else {
				break;
			}
			n--;
		}
		System.out.print(count+1);
	}

}

import java.util.*;
public class BST {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long k = sc.nextLong();
		long num = 1L;
		while (k % 2 == 0) {
			k /= 2;
			num++;
		}
		System.out.print(num);
	}
}

import java.io.*;
public class Chloeandthesequence {

	public static void main(String[] args) throws IOException{
			BufferedReader b = new BufferedReader(new InputStreamReader(System.in));
			String [] l = b.readLine().split(" ");
			long x = Integer.parseInt(l[0]);
			long y =  Long.parseLong(l[1]);
			long s = 1;
			for(int i = 1 ; i < x;i++)
			 s = s*2+1;
			long m =1;
			long lo = 1;
			long hi = s;
			long target= x;
			//System.out.println(s);
			while(lo<hi){

				m = (lo+hi)/2;
				if(y<m){
					hi = m-1;
					target--;
				}else if(y>m){
					lo = m+1;
					target--;
				}else{
				 break;
				}
				//System.out.println(target+" "+y+" "+m);
			}
			System.out.println(target);

	}

}

import java.io.*;
import java.util.*;
public class Q6 {

	static InputReader in=new InputReader(System.in);
	static PrintWriter out=new PrintWriter(System.out);
	public static void main(String args[])
    {
        int n;
        long k;
        n=in.readInt();
        k=in.readLong();
        if(k%2!=0)
            out.println("1");
        else
        {
            out.println(cal(k));
        }
        out.flush();
		out.close();
	 }
    public static int cal(long n)
    {
        if((n%2L)==1L)
            return 1;
        else
            return 1+cal(n/2L);
    }
}
class InputReader{
	private InputStream stream;
	private byte[] buf = new byte[1024];
	private int curChar;
	private int numChars;
	private SpaceCharFilter filter;

	public InputReader(InputStream stream){this.stream = stream;}
	public int read(){
		if (numChars==-1) throw new InputMismatchException();
		if (curChar >= numChars){
			curChar = 0;
			try {numChars = stream.read(buf);}
			catch (IOException e){throw new InputMismatchException();}
			if(numChars <= 0) return -1;
		}
		return buf[curChar++];
	}

	public int readInt(){
		int c = read();
		while(isSpaceChar(c)) c = read();
		int sgn = 1;
		if (c == '-') {sgn = -1;c = read();}
		int res = 0;
		do {
			if(c<'0'||c>'9') throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		}
		while (!isSpaceChar(c)); return res * sgn;
	}

	public long readLong() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
        }
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
        }
		while (!isSpaceChar(c));
            return res * sgn;
    }

	public double readDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
        }
		double res = 0;
		while (!isSpaceChar(c) && c != '.') {
			if (c == 'e' || c == 'E')
				return res * Math.pow(10, readInt());
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
        }
		if (c == '.') {
			c = read();
			double m = 1;
			while (!isSpaceChar(c)) {
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, readInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				m /= 10;
				res += (c - '0') * m;
				c = read();
            }
        }
		return res * sgn;
    }

	public String readString() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

	public String next() {
		return readString();
	}

	public interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyBufferedReader in = new MyBufferedReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, MyBufferedReader in, PrintWriter out) {
            long[] data = in.getALineOfLong(2);
            long n = data[0];
            long k = data[1];

            int res = 0;
            while (k % 2 == 0) {
                k >>>= 1;
                res++;
            }

            out.println(res + 1);
        }

    }

    static class MyBufferedReader {
        BufferedReader in;

        public MyBufferedReader(InputStream s) {
            this.in = new BufferedReader(new InputStreamReader(s));
        }

        public long[] getALineOfLong(int numExpected) {
            long[] res = new long[numExpected];
            StringTokenizer st = null;
            try {
                st = new StringTokenizer(in.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
            for (int i = 0; i < numExpected; i++)
                res[i] = Long.parseLong(st.nextToken());
            return res;
        }

    }
}

import java.util.Scanner;

public class newb {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		long k = scan.nextLong();
		String num = Long.toBinaryString(k);
		for(int i = num.length()-1 ; i >= 0 ; i--){
			if(num.charAt(i) == '1'){
				System.out.println(num.length()-i);
				return;
			}
		}
	}
}

import java.util.*;
import static java.lang.System.out;
import static java.lang.Math.*;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;

public class Main
{

	static int mod = 1000000007;
	static int MOD = 1000000007;
	static final long M = (int)1e9+7;

	static class Pair {
		int first;
		int second;

		public Pair(int first, int second) {
			this.first = first;
			this.second = second;
		}
	}

	static class Reader
	{
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader()
		{
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException
		{
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String next() throws IOException
		{
			byte[] buf = new byte[64]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1)
			{
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException
		{
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do
			{
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');

			if (neg)
				return -ret;
			return ret;
		}
		int[] readArray(int n) throws IOException {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}

		public long nextLong() throws IOException
		{
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			}
			while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException
		{
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();

			do {
				ret = ret * 10 + c - '0';
			}
			while ((c = read()) >= '0' && c <= '9');

			if (c == '.')
			{
				while ((c = read()) >= '0' && c <= '9')
				{
					ret += (c - '0') / (div *= 10);
				}
			}

			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException
		{
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException
		{
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException
		{
			if (din == null)
				return;
			din.close();
		}

	}

	public static boolean isPrime(int n) {
		if(n == 1)
		{
			return false;
		}
		for(int i = 2;i*i<=n;i++)
		{
			if(n%i == 0)
			{
				return false;
			}
		}
		return true;
	}

	public static int gcd(int a, int b)
	{
		if(b == 0)
		 return a;

		else
		return gcd(b,a%b);
	}

	public static long LongGCD(long a, long b)
	{
		if(b == 0)
			 return a;

			else
			return LongGCD(b,a%b);
	}

	public static int lcm(int a, int b)
    {
        return (a / gcd(a, b)) * b;
    }

	public static int phi(int n)  //euler totient function
    {
        int result = 1;
        for (int i = 2; i < n; i++)
            if (gcd(i, n) == 1)
                result++;
        return result;
    }

	public static int[] computePrefix(int arr[], int n)
	{
		int[] prefix = new int[n];
		prefix[0] = arr[0];
		for(int i = 1;i<n;i++)
		{
			prefix[i] = prefix[i-1]+arr[i];
		}

		return prefix;
	}

	public static int fastPow(int x, int n) //include mod at each step if asked and in args of fn too
	{
		if(n == 0)
			return 1;
		else if(n%2 == 0)
			return fastPow(x*x,n/2);
		else
			return x*fastPow(x*x,(n-1)/2);
	}

	static int LowerBound(int a[], int x) {
		  int l=-1,r=a.length;
		  while(l+1<r) {
		    int m=(l+r)>>>1;
		    if(a[m]>=x) r=m;
		    else l=m;
		  }
		  return r;
		}

	static int UpperBound(int a[], int x) {
	    int l=-1,r=a.length;
	    while(l+1<r) {
	       int m=(l+r)>>>1;
	       if(a[m]<=x) l=m;
	       else r=m;
	    }
	    return l+1;
	 }

	   static int power(int x, int y, int p)
	    {

	        int res = 1;

	        x = x % p;

	        while (y > 0) {
	            if (y % 2 == 1)
	                res = (res * x) % p;

	            y = y >> 1;
	            x = (x * x) % p;
	        }

	        return res;
	    }

	    static int modInverse(int n, int p)
	    {
	        return power(n, p - 2, p);
	    }

	    //Fermat's little theorem for nCr % p.
	    static int nCrModPFermat(int n, int r,
	                             int p)
	    {

	          if (n<r)
	              return 0;
	        if (r == 0)
	            return 1;
	        int[] fac = new int[n + 1];
	        fac[0] = 1;

	        for (int i = 1; i <= n; i++)
	            fac[i] = fac[i - 1] * i % p;

	        return (fac[n] * modInverse(fac[r], p)
	                % p * modInverse(fac[n - r], p)
	                % p)
	            % p;
	    }

		public static void Sort(int[] a) {
			List<Integer> l=new ArrayList<>();
			for (int i:a) l.add(i);
			Collections.sort(l);
			//Collections.reverse(l);  //Use to Sort decreasingly
			for (int i=0; i<a.length; i++) a[i]=l.get(i);
		}

	public static void main(String[] args) throws IOException
	{
		Reader sc = new Reader();

		long y = sc.nextLong();
		long n = sc.nextLong();

		int k = 0;
		while(((n>>k)&1) == 0)
		{
			k++;
		}

		System.out.println((k+1));
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class ChloeSeq {

    static int returnK(long l, long r, long idx, int alph){
        long m = l + (r-l)/2;
        if(idx == m)
            return alph;
        else{
            if(idx < m)
                return returnK(l, m-1, idx, alph-1);
            else
                return returnK(m+1, r, idx, alph-1);
        }
    }

    public static void main(String[] args) {
        FastReader f = new FastReader();
        int n = ii(f);
        long k = il(f);
        long len = 1;
        for(int i=0; i<n-1; ++i)
            len = 2 * len + 1;
//        System.out.println(len);
        System.out.println(returnK(0, len, k-1, n));
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

    static int ii(FastReader fr) {
        return fr.nextInt();
    }

    static long il(FastReader fr) {
        return fr.nextLong();
    }

    static double id(FastReader fr) {
        return fr.nextDouble();
    }

    static String is(FastReader fr) {
        return fr.nextLine();
    }

    static void print(Object s) {
        System.out.print(s);
    }

    static void printn(Object s) {
        System.out.println(s);
    }

    static long[] inputArrL(int n, FastReader fr, int idx) {
        long[] arr = new long[n + idx];
        for (int i = idx; i < n + idx; i++)
            arr[i] = fr.nextLong();
        return arr;
    }

    static int[] inputArr(int n, FastReader fr, int idx) {
        int[] arr = new int[n + idx];
        for (int i = idx; i < n + idx; i++)
            arr[i] = fr.nextInt();
        return arr;
    }

    static String[] inputArrS(int n, FastReader fr, int idx) {
        String[] arr = new String[n + idx];
        for (int i = idx; i < n + idx; i++)
            arr[i] = fr.nextLine();
        return arr;
    }

    static int max(int... args) {
        int max = Integer.MIN_VALUE;
        for (int x : args) {
            max = Math.max(x, max);
        }
        return max;
    }

    static int min(int... args) {
        int min = Integer.MAX_VALUE;
        for (int x : args) {
            min = Math.min(x, min);
        }
        return min;
    }

    static long max(long... args) {
        long max = Long.MIN_VALUE;
        for (long x : args) {
            max = Math.max(x, max);
        }
        return max;
    }

    static long min(long... args) {
        long min = Long.MAX_VALUE;
        for (long x : args) {
            min = Math.min(x, min);
        }
        return min;
    }

    static int lenDigit(int d) {
        if (d == 0)
            return 1;
        int l = 0;
        while (d != 0) {
            l++;
            d /= 10;
        }
        return l;
    }

    static void debug(Object... args) {
        for (int i = 0; i < args.length; i += 2) {
            print("[" + args[i] + ":" + args[i + 1] + "]" + " ");
        }
        printn("");
    }

    static int MOD = (int) 1e9 + 7;
}

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import static java.lang.System.in;
import java.lang.reflect.Array;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import static java.util.Collections.list;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;
import java.util.function.Function;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.LongStream;
import java.util.stream.Stream;
import javax.xml.stream.events.Characters;
import sun.security.util.Length;

/**
 *
 * @author george
 */
public class main {
public static boolean isPrime(long n) {
    if(n < 2) return false;
    if(n == 2 || n == 3) return true;
    if(n%2 == 0 || n%3 == 0) return false;
    long sqrtN = (long)Math.sqrt(n)+1;
    for(long i = 6L; i <= sqrtN; i += 6) {
        if(n%(i-1) == 0 || n%(i+1) == 0) return false;
    }
    return true;
}

    private static long f(long l) {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }

public static boolean contains(final int[] arr, final int key) {
    return Arrays.stream(arr).anyMatch(i -> i == key);
}
 static boolean isSubSequence(String str1, String str2, int m, int n)
    {

        if (m == 0)
            return true;
        if (n == 0)
            return false;

        if (str1.charAt(m-1) == str2.charAt(n-1))
            return isSubSequence(str1, str2, m-1, n-1);

        return isSubSequence(str1, str2, m, n-1);
    }

    static int gcdThing(int a, int b) {
    BigInteger b1 = BigInteger.valueOf(a);
    BigInteger b2 = BigInteger.valueOf(b);
    BigInteger gcd = b1.gcd(b2);
    return gcd.intValue();
}
    public static boolean checkAnagram(String str1, String str2) {
        int i=0;
        for (char c : str1.toCharArray()) {
        i = str2.indexOf(c, i) + 1;
        if (i <= 0) { return false; }
    }
    return true;

}

    public static Set primeFactors(int num)
    {
        Set<Integer>Prime=new HashSet<Integer>();
        // Print the number of 2s that divide n
        int tw=2;
        while (num%2==0)
        {
            Prime.add(tw);
            num /= 2;
        }

        // n must be odd at this point.  So we can
        // skip one element (Note i = i +2)
        for (int i = 3; i <= Math.sqrt(num); i+= 2)
        {
            // While i divides n, print i and divide n
            while (num%i == 0)
            {
                Prime.add(i);
                num/= i;
            }
        }

        // This condition is to handle the case whien
        // n is a prime number greater than 2
        if (num> 2)
            Prime.add(num);
        return Prime;
    }
    public static String Winner(int [] arr)
    {
        int maxsum=-1;
        int temp=0;
        List<Integer> L=Arrays.stream(arr).boxed().collect(Collectors.toList());
        int count=0;
        String winner="First";
        while(L.isEmpty()!=true){
           if(count%2==0){winner="First";
           //take max odd interval
            for (int i = 0; i < L.size(); i++) {

            }
            }
           else{winner="Second";

           }
           count++;
        }

    return winner;
    }
    public static String changeCharInPosition(int position, char ch, String str){
    char[] charArray = str.toCharArray();
    charArray[position] = ch;
    return new String(charArray);
    }
    public static boolean CheckCanObtainYfromX(String y,String x){
        boolean cond=true;
        String help="";
        for (int i = 0; i < y.length(); i++) {
            help="";help+=y.charAt(i);
            if(y.contains(help)==false){x=x.replaceFirst(help,"A");cond=false;break;}

        }
        return cond;
    }
   public static int LongestPalindrome(String x){
    int n=x.length();
    boolean table[][] = new boolean[n][n];
    int maxLength = 1;
     for (int i = 0; i < n; ++i)
            table[i][i] = true;
   int start = 0;
    for (int i = 0; i < n - 1; ++i) {
            if (x.charAt(i) == x.charAt(i + 1)) {
                table[i][i + 1] = true;
                start = i;
                maxLength = 2;
            }
        }
     for (int k = 3; k <= n; ++k) {
            for (int i = 0; i < n - k + 1; ++i)
            {
                int j = i + k - 1;
               if (table[i + 1][j - 1] && x.charAt(i) == x.charAt(j)) {
                    table[i][j] = true;
                if (k > maxLength) {
                        start = i;
                        maxLength = k;
                    }
                }
            }
     }
   return maxLength;
   }
   public static long choose(long total, long choose){
    if(total < choose)
        return 0;
    if(choose == 0 || choose == total)
        return 1;
    return choose(total-1,choose-1)+choose(total-1,choose);
}
    public static long bitwiseAdd(int n1, int n2) {
        int x = n1, y = n2;
        int xor, and, temp;
        and = x & y;
        xor = x ^ y;

        while (and != 0) {
            and <<= 1;
            temp = xor ^ and;
            and &= xor;
            xor = temp;
        }
        return (xor%2);
    }
   public static void mex(int [] xx){

   }

    public static void main (String []  args) throws IOException
    {
        Scanner s=new Scanner(System.in);
        int n=s.nextInt();long k=s.nextLong();
        //for n  we have 2^(n-1)-1 on right and on left and we have (n) the number on the middle
        if(k%2!=0){System.out.print(1);System.exit(0);}
        if(k==Math.pow(2, n-1)){System.out.print(n);System.exit(0);}
        //all even positions have a range of 2 to n-1 inclusive
                //Every 2^i-1=i for i>1 or else it is 2
        long temp=k;
            for (int i = 50; i >2; i--) {
            if(temp>Math.pow(2, i-1)){temp=temp-(long)Math.pow(2, i-1);}
            if(temp==Math.pow(2, i-1)){System.out.print(i);System.exit(0);}

        }

        System.out.print(2);

      }
   }

import java.io.*;
import java.util.*;

public class spoj
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next()
		{
			while(st==null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch(IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str="";
			try
			{
				str = br.readLine();
			}
			catch(IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String args[]) throws IOException
	{
		FastReader fr = new FastReader();
		long low=0L,high=1L,mid,m;
		long n = fr.nextLong();
		long k = fr.nextLong();
		k--;
		if(k==(Math.pow(2,n)-1)/2)
		{
			System.out.println(n);
		}
		else if(k%2==0)
		{
			System.out.println(1);
		}
		else
		{
			low = 0L;
			high = (long)Math.pow(2,n)-1;
			while(low<high)
			{
				mid  = (low+high)/2;
				if(k>mid)
				{
					low = mid + 1;
				}
				else if(k<mid)
				{
					high = mid;
				}
				else
				{
					break;
				}
				n--;
			}
			System.out.println(n);
		}

 	}
}

import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Main {

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int n = sc.nextInt();
        long k = sc.nextLong();

        n = 1;
        while(k > 0 && k % 2 != 1) {
            n++;
            k /= 2;
        }

        pw.println(n);
        pw.close();
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong(), m = in.nextLong();
            long cnt = 1;
            while (m % 2 == 0) {
                cnt++;
                m /= 2;
            }
            out.println(cnt);

        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.util.Scanner;

/**
 * Created by for on 2017-01-30.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        long k = sc.nextLong();

        long size = 1;
        for(int i = 1; i < n; i++) {
            size = size * 2 + 1;
        }

        long left = 1;
        long right = size;
        long m = -1;

        while(n > -1) {
            m = left + (right-left)/2;

            if(k < m) {
                right = m-1;
            } else if(k > m) {
                left = m+1;
            } else {
                System.out.println(n);
                break;
            }
            n--;
        }

       // System.out.println(go(1, size, k, n));
    }

    /*
    private static int go(long l, long r, long need, int alphSize) {
        long m = l + (r-l) / 2;

        if(need < m) {
            return go(l, m-1, need, alphSize-1);
        } else if(need > m) {
            return go(m+1, r, need, alphSize - 1);
        } else
            return alphSize;
    }
    */
}

//package com.company;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class Main {

    public static void main(String[] args) throws IOException {
        // write your code here
        Scanner s = new Scanner(System.in);
        //  BufferedReader s=new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int n=s.nextInt();long k=s.nextLong();
        for(int i=1;i<=n;i++){
            if((k-Math.pow(2,i-1))%Math.pow(2,i)==0){
                System.out.println(i);break;
            }
        }
    }

    static double power(double x, long y, int p)
    {
        double res = 1;
 x = x % p;
        while (y > 0)
        {
            if((y & 1)==1)
                res = (res * x) % p;
            y = y >> 1;
            x = (x * x) % p;
        }
        return res;
    }
    static int m;
    static int n;
    static int path = Integer.MAX_VALUE;
    static int got = 0;

    public static void dfs(int papa, int i, ArrayList<Integer>[] h, int[] vis) {
        vis[i] = 1;
        for (Integer j : h[i]) {
            if (vis[j] == 0) {
                dfs(i, j, h, vis);
            } else if (vis[j] == 1 && j != papa) {
                got = 1;
                return;
            }
        }
    }

    public static void bfs(int i, HashMap<Integer, Integer>[] h, int[] vis, int len, int papa) {
        Queue<Integer> q = new LinkedList<Integer>();
        q.add(i);

    }

    static int i(String a){
        return Integer.parseInt(a);
    }static long l(String a){
        return Long.parseLong(a);
    }static String[] inp() throws IOException{
        BufferedReader s=new BufferedReader(new InputStreamReader(System.in));
        return s.readLine().trim().split("\\s+");
    }
}

class Student
{
 int t,l,r;
//    String name, address;

    // Constructor
    public Student(int t,int r)
    {this.t=t;

        this.r=r;
    }

    // Used to print student details in main()
    public String toString()
    {
        return this.t + " " +this.l+" "+this.r;
    }
}

class Sortbyroll implements Comparator<Student>
{
    // Used for sorting in ascending order of
    // roll number
    public int compare(Student a, Student b)
    {
        return a.t-b.t;
    }
}

import java.util.*;
import java.lang.*;
import java.io.*;
import java.awt.Point;

// SHIVAM GUPTA :
//NSIT
//decoder_1671
//BEING PERFECTIONIST IS NOT AN OPTION.
// STOP NOT TILL IT IS DONE OR U DIE .
//EITHER MAKE IT OR BREAK IT.
//NEVER UNDERESTIMATE URSELF.
// U KNOW THAT IF THIS DAY WILL BE URS THEN NO ONE CAN DEFEAT U
// REST ..HAVE FAITH ON DESTINY

// ASCII = 48 + i ;

// 2^28 = 268,435,456  > 10^8

// log 10 base 2 = 3.3219

// odd:: (x^2+1)/2 , (x^2-1)/2 ; x>=3

// even:: (x^2/4)+1 ,(x^2/4)-1  x >=4

/* Name of the class has to be "Main" only if the class is public. */

public class Main
{

    // static int[] arr = new int[100002] ;
    // static int[] dp = new int[100002] ;

    static PrintWriter out;

	static class FastReader{
		BufferedReader br;
		StringTokenizer st;
		public FastReader(){
			br=new BufferedReader(new InputStreamReader(System.in));
			out=new PrintWriter(System.out);
		}
		String next(){
			while(st==null || !st.hasMoreElements()){
				try{
					st= new StringTokenizer(br.readLine());
				}
				catch (IOException e){
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		long nextLong(){
			return Long.parseLong(next());
		}
		double nextDouble(){
			return Double.parseDouble(next());
		}
		String nextLine(){
			String str = "";
			try{
				str=br.readLine();
			}
			catch(IOException e){
				e.printStackTrace();
			}
			return str;
		}
	}

/////////////////////////////////////////////////////////////////////////////////////

public static int  min(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[0];

}

 /////////////////////////////////////////////////////////////////////////////

public static int  max(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[3];

}

///////////////////////////////////////////////////////////////////////////////////
static int sieve =  1000000 ;

static boolean[] prime =  new boolean[sieve + 1] ;

public static void sieveOfEratosthenes()
    {
        // FALSE == prime

        // TRUE ==  COMPOSITE

        // FALSE== 1

        // time complexity = 0(NlogLogN)== o(N)

        // gives prime nos bw 1 to N

        for(int i = 2; i<= sieve ; i++)
        {
            prime[i] = true  ;
            i++ ;
        }

        for(int p = 3; p*p <= sieve; p++)
        {

            if(prime[p] == false)
            {

                for(int i = p*p; i <= sieve; i += p)
                    prime[i] = true;
            }

            p++ ;
        }

    }

///////////////////////////////////////////////////////////////////////////////////

public static String reverse(String input)
{
    String op = "" ;

    for(int i = 0; i < input.length() ; i++ )
    {
        op = input.charAt(i)+  op ;
    }

return op ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static void sortD(int[] arr , int s  , int e)
{
      sort(arr ,s , e) ;

      int i =s ; int j = e  ;

      while( i < j)
      {
            int temp = arr[i] ;
            arr[i] =arr[j] ;
            arr[j] = temp ;
            i++ ; j-- ;
      }

      return ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(long a  ,long b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(int a  ,int b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

////////////////////////////////////////////////////////////////////////////////////

public static boolean isPossibleTriangle(int a  ,int b , int c)
{
      if( a + b > c && c+b > a && a +c > b)
      {
            return true  ;
      }

      return false  ;

}

/////////////////////////////////////////////////////////////////////////////////

public static long countSubarraysSumToK(long[] arr ,long sum )
    {
      HashMap<Long,Long> map = new HashMap<>() ;

      int n = arr.length ;

      long prefixsum = 0 ;

      long count = 0L ;
      for(int i  = 0; i < n ; i++)
      {
          prefixsum  = prefixsum +  arr[i] ;

          if(sum == prefixsum)count = count+1 ;

          if(map.containsKey(prefixsum -sum))
          {
              count = count + map.get(prefixsum -sum) ;
          }

          if(map.containsKey(prefixsum ))
          {
              map.put(prefixsum , map.get(prefixsum) +1 );
          }

          else{
              map.put(prefixsum , 1L );
          }

      }

      return count  ;

    }

///////////////////////////////////////////////////////////////////////////////////////

public static int gcd(int a, int b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

//////////////////////////////////////////////////////////////////////////////////
public static long gcd(long a, long b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c , int d )
{

int temp = lcm(a,b , c) ;

 int ans = lcm(temp ,d ) ;

return ans  ;

}

//////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c )
{

int temp = lcm(a,b) ;

int ans =  lcm(temp ,c) ;

return ans  ;

}

////////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a , int b )
{

int gc = gcd(a,b);

return (a*b)/gc ;

}

///////////////////////////////////////////////////////////////////////////////////

    // CALCULATE TOTIENT Fn FOR ALL VALUES FROM 1 TO n
    // TOTIENT(N) = count of nos less than n and grater than 1 whose gcd with n is 1
    // or n and the no  will be coprime in nature
    //time : O(n*(log(logn)))

    public static void eulerTotientFunction(int[] arr ,int n )
    {

      for(int i = 1; i <= n  ;i++)arr[i] =i  ;

      for(int i= 2 ; i<= n ;i++)
      {
          if(arr[i] == i)
          {
              arr[i] =i-1 ;

              for(int j =2*i ; j<= n  ; j+= i )
              {
                  arr[j] = (arr[j]*(i-1))/i ;
              }

          }
      }

      return  ;

    }

/////////////////////////////////////////////////////////////////////////////////////////////

static boolean isPrime(int n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(int i = 2; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}

static boolean isPrime(long n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(long i = 2L; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}
//////////////////////////////////////////////////////////////////////////////////////////
public static long nCr(int n,int k)
{
    long ans=1;
    k=k>n-k?n-k:k;
    int j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
///////////////////////////////////////////////////////////////////////////////////////////

public static ArrayList<Integer> allFactors(int n)
{
      ArrayList<Integer> list = new ArrayList<>() ;

    for(int i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

///////////////////////////////////////////////////////////////////////////

public static ArrayList<Long> allFactors(long n)
{
      ArrayList<Long> list = new ArrayList<>() ;

    for(long i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

/////////////////////////////////////////////////////////////////////////////

public static boolean isPowerOfTwo(int n)
{
    if(n==0)
    return false;

if(((n ) & (n-1)) == 0 ) return true ;
else return false  ;

}

////////////////////////////////////////////////////////////////////////////////////

    public static int countDigit(long n)
    {
        return (int)Math.floor(Math.log10(n) + 1);
    }

 /////////////////////////////////////////////////////////////////////////////////////////

 public static int sumOfDigits(long n)
 {

  if( n< 0)return -1 ;

  int sum = 0;

  while( n > 0)
  {
      sum = sum + (int)( n %10) ;

      n /= 10 ;
  }

  return sum ;

 }
 /////////////////////////////////////////////////////////////////////////////////////////

  static final int MAXN = 100001;

    static int spf[] = new int[MAXN];

    static void sieve()
    {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)

            spf[i] = i;

        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;

        for (int i=3; i*i<MAXN; i++)
        {

            if (spf[i] == i)
            {

                for (int j=i*i; j<MAXN; j+=i)

                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }

// The above code works well for n upto the order of 10^7.
// Beyond this we will face memory issues.

// Time Complexity: The precomputation for smallest prime factor is done in O(n log log n)
// using sieve.
// Where as in the calculation step we are dividing the number every time by
// the smallest prime number till it becomes 1.
// So, let’s consider a worst case in which every time the SPF is 2 .
// Therefore will have log n division steps.

// Hence, We can say that our Time Complexity will be O(log n) in worst case.

    static Vector<Integer> getFactorization(int x)
    {
        Vector<Integer> ret = new Vector<>();
        while (x != 1)
        {
            ret.add(spf[x]);
            x = x / spf[x];
        }
        return ret;
    }

  //////////////////////////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////////////////////////

public static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int[n1];
        int R[] = new int[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
  public static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
public static void sort(long arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

public static void merge(long arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        long L[] = new long[n1];
        long R[] = new long[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

 /////////////////////////////////////////////////////////////////////////////////////////

	public static long knapsack(int[] weight,long value[],int maxWeight){

        int n=  value.length ;

	//dp[i] stores the profit with KnapSack capacity "i"
  long []dp = new long[maxWeight+1];

    //initially profit with 0 to W KnapSack capacity is 0
    Arrays.fill(dp, 0);

    // iterate through all items
    for(int i=0; i < n; i++)

        //traverse dp array from right to left
        for(int j = maxWeight; j >= weight[i]; j--)
            dp[j] = Math.max(dp[j] , value[i] + dp[j - weight[i]]);

    /*above line finds out maximum of dp[j](excluding ith element value)
    and val[i] + dp[j-wt[i]] (including ith element value and the
    profit with "KnapSack capacity - ith element weight") */
    return dp[maxWeight];
	}

///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////

// to return max sum of any subarray in given array
public static long kadanesAlgorithm(long[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}
/////////////////////////////////////////////////////////////////////////////////////////////
public static long kadanesAlgorithm(int[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}

///////////////////////////////////////////////////////////////////////////////////////

// Arrays.sort(arr, new Comparator<Pair>() {
// 			@Override
// 			public int compare(Pair first, Pa second) {
// 				if (first.getAge() != second.getAge()) {
// 					return first.getAge() - second.getAge();
// 				}
// 				return first.getName().compareTo(second.getName());
// 			}
// 		});

/////////////////////////////////////////////////////////////////////////////////////////

public static long binarySerachGreater(int[] arr , int start , int end , int val)
{

      // fing total no of elements strictly grater than val in sorted array arr

      if(start >  end)return  0 ; //Base case

      int mid = (start + end)/2  ;

      if(arr[mid] <=val)
      {
          return binarySerachGreater(arr,mid+1, end ,val) ;

      }
      else{

         return binarySerachGreater(arr,start , mid -1,val) + end-mid+1 ;

      }

}

//////////////////////////////////////////////////////////////////////////////////

//TO GENERATE ALL(DUPLICATE ALSO EXIST) PERMUTATIONS OF A STRING

//Function for swapping the characters at position I with character at position j
    public static String swapString(String a, int i, int j) {
        char[] b =a.toCharArray();
        char ch;
        ch = b[i];
        b[i] = b[j];
        b[j] = ch;
        return String.valueOf(b);
    }

//Function for generating different permutations of the string
    public static void generatePermutation(String str, int start, int end)
    {
        //Prints the permutations
        if (start == end-1)
            System.out.println(str);
        else
        {
            for (int i = start; i < end; i++)
            {
                //Swapping the string by fixing a character
                str = swapString(str,start,i);
                //Recursively calling function generatePermutation() for rest of the characters
                generatePermutation(str,start+1,end);
                //Backtracking and swapping the characters again.
                str = swapString(str,start,i);
            }
        }
    }

// JUST CALL generatePermutation( str,  start,  end) start :inclusive ,end : exclusive

////////////////////////////////////////////////////////////////////////////////////

public static long arraySum(int[] arr , int start , int end)
{
    long ans = 0 ;

    for(int i = start ; i <= end  ; i++)ans += arr[i] ;

    return ans  ;
}

/////////////////////////////////////////////////////////////////////////////////

public static int mod(int x)
{
      if(x <0)return -1*x ;
      else return x ;
}
public static long mod(long x)
{
      if(x <0)return -1*x ;
      else return x ;
}

////////////////////////////////////////////////////////////////////////////////

public static void swapArray(int[] arr , int start , int end)
{
    while(start < end)
    {
        int temp = arr[start] ;
        arr[start] = arr[end];
        arr[end] = temp;
        start++ ;end-- ;
    }
}

//////////////////////////////////////////////////////////////////////////////////

public static long factMod(long n, long mod) {
    if (n <= 1) return 1;
    long ans = 1;
    for (int i = 1; i <= n; i++) {
      ans = (ans * i) % mod;
    }
    return ans;
  }

/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
public static long power(int x  ,int n)
    {
        //time comp : o(logn)

        if(n==0)return 1 ;
        if(n==1)return x;

        long ans =1  ;

      while(n>0)
      {
          if(n % 2 ==1)
          {
              ans = ans *x ;
          }

          n /= 2 ;

          x =  x*x ;

      }

      return ans ;
    }

////////////////////////////////////////////////////////////////////////////////////////////////////
public static long powerMod(long x, long n, long mod) {
    //time comp : o(logn)

    if(n==0)return 1L ;
        if(n==1)return x;

    long ans = 1;
    while (n > 0) {
      if (n % 2 == 1) ans = (ans * x) % mod;
      x = (x * x) % mod;
      n /= 2;
    }
    return ans;
  }

//////////////////////////////////////////////////////////////////////////////////

public static int[][] rotate(int[][] input){

int n =input.length;
int m = input[0].length ;
int[][] output = new int [m][n];

for (int i=0; i<n; i++)
	for (int j=0;j<m; j++)
		output [j][n-1-i] = input[i][j];
return output;
}

//////////////////////////////////////////////////////////////////////////////////

/*
lowerBound - finds largest element equal or less than value paased
upperBound - finds smallest element equal or more than value passed

if not present return -1;

*/

public static long lowerBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static int lowerBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static long upperBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

	public static int upperBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

/////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////

public static void solve()
{
FastReader scn = new FastReader() ;

//ArrayList<Integer> list = new ArrayList<>() ;
ArrayList<Long> list = new ArrayList<>() ;
ArrayList<Integer> lista = new ArrayList<>() ;
ArrayList<Integer> listb = new ArrayList<>() ;

//HashMap<Integer,Integer> map = new HashMap<>() ;
HashMap<Long,Integer> map = new HashMap<>() ;
HashMap<Integer,Integer> map1  = new HashMap<>() ;
HashMap<Integer,Integer> map2  = new HashMap<>() ;
//HashMap<Point,> point = new HashMap<>() ;

//int[] store = {2 ,3, 5 , 7  ,11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 } ;

// product of first 11 prime nos is gre ater than 10 ^ 12;

//HashMap<String,Integer> maps = new HashMap<>() ;
//HashMap<Integer,Boolean> mapb = new HashMap<>() ;

//if(map.containsKey(arr[i]))map.put(arr[i] , map.get(arr[i]) +1 ) ;
//else map.put(arr[i],1) ;

// if(map.containsKey(temp))map.put(temp , map.get(temp) +1 ) ;
// else map.put(temp,1) ;

Set<Integer> set = new HashSet<>() ;
//Set<Integer> sety = new HashSet<>() ;

int t = 1;
// t = scn.nextInt() ;

while(t-- > 0)
{

 //String str  = scn.next() ;
 //long n = scn.nextLong() ;
  //long k = scn.nextLong() ;

 //int n = scn.nextInt() ;
 //int m = scn.nextInt() ;
//int k = scn.nextInt() ;
// int x  = scn.nextInt() ;
// int y = scn.nextInt() ;
 //int a = scn.nextInt() ;
//long a = scn.nextLong() ;
 //int b = scn.nextInt() ;
//long b = scn.nextLong() ;
 //int c = scn.nextInt() ;
// int d = scn.nextInt() ;

long n = scn.nextLong() ;

long k = scn.nextLong() ;

long ans = n ;

long start =1L ;
long end = (long)Math.pow(2.0 ,((n)*1.0)) -1L;

while(start <= end)
{
    long mid  =(start +end)/2L ;

    if(mid == k)
    {
      break ;
    }

    else if( mid > k)
    {

        end = mid-1 ;
         ans-- ;

    }

    else{

        start = mid+1;
        ans-- ;

    }

}

out.println(ans) ;

//for(int i = 0; i < n; i++)out.print(arr[i]+ " ") ;

//out.println() ;

list.clear() ;
map.clear() ;
map1.clear() ;
map2.clear() ;
set.clear() ;
} // test case  end loop

out.flush() ;
}

public static void main (String[] args) throws java.lang.Exception
{

solve() ;

}

}

 class Pair
{
  int first ;

  int second  ;

@Override
	public String toString() {

	String ans = "" ;
	ans  += this.first ;
	ans += " ";
	ans += this.second ;

	return ans  ;
	}

}

import java.util.ArrayList;
import java.util.Scanner;

public class b {
	static ArrayList<Long> a;
	static long ans;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		long k = scan.nextLong();
		a = new ArrayList<>();
		make();
		if(k%2 == 1) System.out.println(1);
		else{
			ans = 0;
			int index = 0;
			for(int i = a.size()-1 ; i >= 0 ; i--){
				if(k > a.get(i)){
					index = i+1;
					break;
				}
				if(k == a.get(i)){
					System.out.println(i+1);
					return;
				}
			}
			find(k, 0, a.get(index), index+1);
			System.out.println(ans);
		}
	}
	static void find(long k, long l, long r, long curr){
		if(l == k || r == k){
			ans = curr;
			return;
		}
		long temp = ((r-l)/2);
		if(k >= l+temp) find(k, l+temp, r, curr-1);
		else find(k, l, r-temp, curr-1);
	}
	static void make(){
		for(int i = 0 ; i <= 50 ; i++){
			a.add((long)Math.pow(2, i));
		}
	}
}

import java.util.*;
import java.io.*;

public final class Solution
{
    public static void main(String[] args)
    {
        Reader input = new Reader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = input.nextInt();
        long k = input.nextLong();
        if(k % 2 != 0)
        	out.println(1);
        else
        {
        	double log = Math.log10(k) / Math.log10(2);
        	if( log - (int)log < 0.0001)
        	{
        		out.println((int)log + 1);
        	}
        	else
        	{
        		for(int i = 1 ;i <= n ; i++)
        		{
        			long initial = (long)Math.pow(2, i);
        			long power = (long)Math.pow(2, i + 1);
        			if((k - (long)initial) % (long)power == 0)
        			{
        				out.println(i + 1);
        				break;
        			}
        		}
        	}
        }
        out.close();

    }
    public static class Reader
    {
    	BufferedReader br;
    	StringTokenizer st;
    	public Reader()
    	{
    		br = new BufferedReader(new InputStreamReader(System.in));
    	}
    	public String next()
    	{
    		try
    		{
        		if(st == null || !st.hasMoreTokens())
        			st = new StringTokenizer(br.readLine());
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return st.nextToken();
    	}
    	public int nextInt()
    	{
    		return Integer.parseInt(next());
    	}
    	public double nextDouble()
    	{
    		return Double.parseDouble(next());
    	}
    	public long nextLong()
    	{
    		return Long.parseLong(next());
    	}
    	public String nextLine()
    	{
    		try
    		{
    			return br.readLine();
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return "";
    	}
    }
}

import java.util.*;

public class qbalt{

	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		Double k = s.nextDouble();
		Double candidato = 1.0;
		while(k != 1){
			if(k % 2 == 0){
				candidato ++;
				k = k/2;
			}
			else{
				break;
			}
		}
		System.out.println(candidato.intValue());
	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class MainB {
	public static void main(String[] args) throws IOException {

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		int n = Integer.parseInt(st.nextToken());
		long idx = Long.parseLong(st.nextToken());
		long [] intervals = new long[n + 1];
		long [] startPoints = new long[n + 1];
		for(int i = 1; i <= n; i++) {
			intervals[i] = intervals[i - 1] * 2 + 1;
		}
		for(int i = 1; i <= n; i++) {
			startPoints[i] = ++intervals[i]/2;
			if(idx >= startPoints[i]) {
				if((idx - startPoints[i]) % intervals[i] == 0) {
					System.out.println(i);
					return;
				}
			}
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author HossamDoma
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {

            int n = in.nextInt();
            long k = in.nextLong();

            out.println(Long.numberOfTrailingZeros(Long.lowestOneBit(k)) + 1);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public Long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.util.Scanner;

/**
 * Created by kyr7 on 14/12/2016.
 */
public class Line {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long size = scanner.nextLong();
        long pos = scanner.nextLong();
        System.out.println(find(size - 1, pos));
        scanner.close();
    }

    private static long find(long size, long pos) {
        long length = 1;
        long level = 1;
        if (pos <= 1) {
            return 1;
        }
        for (; level <= size; level++) {
            length = length * 2 + 1;
        }
        if (pos >= length) {
            return 1;
        }
        long middle = length / 2 + 1;
        if (pos == middle) {
            //middle
            return level;
        }
        if (pos < middle) {
            return find(size - 1, pos);
        } else {
            return find(size - 1, middle - (pos - middle));
        }
    }

}

import java.util.*;
public class practic{
	static Scanner sc= new Scanner(System.in);
	public static void main(String[] args){
       int n =sc.nextInt();
       long k = sc.nextLong();
       if(k%2!=0){
    	   System.out.println(1);
       }
       else{
    	   String s = Long.toBinaryString(k);
    	   for(int i=s.length()-1,j=0;i>=0;i--,j++){
    		   if(s.charAt(i)=='1'){
    			   System.out.println(j+1);
    			   break;
    		   }
    	   }
       }
    }
}

import java.util.*;
public class BST {
	public static void main(String[]args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long k = sc.nextLong();
		long num = 1L;
		while (k % 2 == 0) {
			k /= 2;
			num++;
		}
		System.out.print(num);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class A {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, InputReader in, PrintWriter out)
        {
        	int n=in.nextInt();
        	long k=in.nextLong();
        	int count=1;
        	while(k%2==0)
        	{
        		count++;
        		k/=2;
        	}
        	System.out.print(count);
        }

    }

    static long min2(long x,long y){return x<y?x:y;}
    static long min3(long x,long y,long z){return x<y?(x<z?x:z):(y<z?y:z);}
    static long min4(long n1,long n2,long n3,long n4){
    	return n1<n2?(n1<n3?(n1<n4?n1:n4):(n3<n4?n3:n4)):(n2<n3?(n2<n4?n2:n4):(n3<n4?n3:n4));}
    static long max2(long x,long y){return x>y?x:y;}
    static long max3(long x,long y,long z){return x>y?(x>z?x:z):(y>z?y:z);}
    static long max4(long n1,long n2,long n3,long n4){
    	return n1>n2?(n1>n3?(n1>n4?n1:n4):(n3>n4?n3:n4)):(n2>n3?(n2>n4?n2:n4):(n3>n4?n3:n4));}
    static int min2(int x,int y){return x<y?x:y;}
    static int max2(int x,int y){return x>y?x:y;}

    static long abs(long x){if(x<0) return -x; else return x;}
    static int abs(int x){if(x<0) return -x; else return x;}

    static long sumarr(int arr[],int n1,int n2){
    	long sum=0; for(int i=n1-1;i<n2;i++) sum=sum+arr[i];  return sum; }

//**************************************Reader Class**************************************************//

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
        	return Long.parseLong(next());
        }

        public double nextDouble() {
        	return Double.parseDouble(next());
        }

    }
}

import java.io.*;
import java.util.*;

public class Problem implements Runnable {

    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok = new StringTokenizer("");

    private void init() throws FileNotFoundException {
        Locale.setDefault(Locale.US);
        String fileName = "";
        if (ONLINE_JUDGE && fileName.isEmpty()) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }
        }
    }

    String readString() {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() {
        return Integer.parseInt(readString());
    }

    long readLong() {
        return Long.parseLong(readString());
    }

    double readDouble() {
        return Double.parseDouble(readString());
    }

    public static void main(String[] args) {
        new Problem().run();
    }

    public void run() {
        try {
            init();
            solve();
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    private void solve() throws IOException {
        long n = readLong(),k=readLong(),ans=1;
        if (k%2!=1) {
            if ((k & (k - 1)) == 0) {
                while (Math.pow(2,ans)<k) ans++;
                ans++;
            } else {
                for (long i = 1; i < n; i++)
                    if ((k-Math.pow(2,i))%Math.pow(2,i+1)==0)
                        ans = i+1;
            }
        }
        out.print(ans);
    }
}

import java.io.*;
import java.util.*;

public class chloeseq {
    public static void main(String[] args) throws IOException {
        Scanner scan=new Scanner(System.in);
        StringTokenizer st=new StringTokenizer(scan.nextLine());
        int max=Integer.parseInt(st.nextToken());
        long position=Long.parseLong(st.nextToken());
        long lo=0, hi=(long)Math.pow(2,max);
        int counter=max+1;
        long middle=0;
        while(middle!=position){
            middle=(hi+lo)/2;
            if(middle>position){
                hi=middle;
            }else{
                lo=middle;
            }
            counter--;
        }
        System.out.println(counter);

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class ChloeAndTheSequence {

	static long go(long l , long r , long k , long n)
	{
		long mid = (l+r)/2;
//		System.out.prlongln(l+" "+r+" "+k+" "+n);
//		Thread.sleep(4000);
		if(k < mid)
			return go(l, mid-1, k, n-1);
		else if(k>mid)
			return go(mid+1, r, k, n-1);
		else
			return n;
	}
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a[] = br.readLine().split(" ");
		long n = Long.parseLong(a[0]);
		long k = Long.parseLong(a[1]);
		long count = 1;
		for(long i=1;i<n;i++)
			count = count * 2 + 1;
		System.out.println(go(1,count,k,n));
	}
}

//package main;

import java.io.*;
import java.util.*;

public final class Main {
    BufferedReader br;
    StringTokenizer stk;

    public static void main(String[] args) throws Exception {
        new Main().run();
    }

    {
        stk = null;
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    long mod = 998244353;

    void run() throws Exception {
        long n = ni(), K = nl();
        long high = (1L << n) - 1L, low = 1, mid;
        while(true) {
            //System.out.println(low + " " + high);
            mid = (high + low) / 2L;
            if(mid == K) break;
            if(mid < K) {
                low  = mid + 1;
            } else {
                high = mid - 1;
            }
            n--;
        }
        System.out.println(n);
    }

    //Reader & Writer
    String nextToken() throws Exception {
        if (stk == null || !stk.hasMoreTokens())
            stk = new StringTokenizer(br.readLine(), " ");
        return stk.nextToken();
    }

    String nt() throws Exception {
        return nextToken();
    }

    int ni() throws Exception {
        return Integer.parseInt(nextToken());
    }

    long nl() throws Exception {
        return Long.parseLong(nextToken());
    }

    double nd() throws Exception {
        return Double.parseDouble(nextToken());
    }

    //Some Misc methods
    int get(int l, int r, int[] a) {
        return l == 0 ? a[r] : a[r] - a[l - 1];
    }

    void shuffle(int[] a) {
        Random r = new Random();
        for(int i = 0; i < a.length; i++) {
            int idx = r.nextInt(a.length);
            int temp = a[i];
            a[i] = a[idx];
            a[idx] = temp;
        }
    }

    void reverse(char[] a) {
        for(int i = 0, j = a.length - 1; i < j; i++, j--) {
            char temp = a[i];
            a[i] = a[j];
            a[j] = temp;
        }
    }
}

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

/**
 * @author maxkrivich
 */
public final class Main {
    private void solve() {
        int n = in.nextInt();
        long k = in.nextLong();
        long x = Long.MAX_VALUE;
        int z=1;
        for (long i=1;i<=x;i*=2){
            if (k % (i*2) == i){
                out.print(z);
                return;
            }
            z++;
        }
    }

    //    -------------I/O-------------    \\
    void run() {
        try {
            in = new FScanner(new File("input.txt"));
            out = new PrintWriter(new BufferedWriter(new FileWriter(new File("output.txt"))));
            solve();
            out.close();
            in.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    void runIO() {
        in = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
        in.close();
    }

    public static void main(String[] args) {
        new Main().runIO();
    }

    private FScanner in;
    private PrintWriter out;

    class FScanner {

        private BufferedReader br;
        private StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            }
        }

        void useString(String s) {
            if (s != null) {
                st = new StringTokenizer(s);
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }

        void close() {
            try {
                br.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
}

import java.util.*;
import java.io.*;

public final class Solution
{
    public static void main(String[] args)
    {
        Reader input = new Reader();
        PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));
        int n = input.nextInt();
        long k = input.nextLong();
        if(k % 2 != 0)
        	out.println(1);
        else
        {
        	double log = Math.log10(k) / Math.log10(2);
        	if( log - (int)log < 0.0001)
        	{
        		out.println((int)log + 1);
        	}
        	else
        	{
        		for(int i = 1 ;i <= n ; i++)
        		{
        			long initial = (long)Math.pow(2, i);
        			long power = (long)Math.pow(2, i + 1);
        			if((k - initial) % power == 0)
        			{
        				out.println(i + 1);
        				break;
        			}
        		}
        	}
        }
        out.close();

    }
    public static class Reader
    {
    	BufferedReader br;
    	StringTokenizer st;
    	public Reader()
    	{
    		br = new BufferedReader(new InputStreamReader(System.in));
    	}
    	public String next()
    	{
    		try
    		{
        		if(st == null || !st.hasMoreTokens())
        			st = new StringTokenizer(br.readLine());
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return st.nextToken();
    	}
    	public int nextInt()
    	{
    		return Integer.parseInt(next());
    	}
    	public double nextDouble()
    	{
    		return Double.parseDouble(next());
    	}
    	public long nextLong()
    	{
    		return Long.parseLong(next());
    	}
    	public String nextLine()
    	{
    		try
    		{
    			return br.readLine();
    		}
    		catch(IOException ex)
    		{
    			ex.printStackTrace();
    			System.exit(1);
    		}
    		return "";
    	}
    }
}

import java.io.*;
import java.util.*;
import java.math.BigInteger;

public class Main {

    static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int n = sc.nextInt();
        long k = sc.nextLong();

        n = 1;
        while(k > 0 && k % 2 != 1) {
            n++;
            k /= 2;
        }

        pw.println(n);
        pw.close();
    }
}

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        scanner.nextInt();
        long k = scanner.nextLong();

        int i = 1;
        while (k % 2 == 0){
            i++;
            k/=2;
        }

        System.out.println(i);

    }
}

import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
import javax.print.attribute.standard.Compression;

public class Solution {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        long k = in.nextLong();
        if (k % 2 == 1) {
            System.out.println(1);
        } else {
            System.out.println(run(k));
        }
    }

    private static int run(long k) {
        double d = Math.log10(k) / Math.log10(2);
        if (d - (long) d == 0) {
            int ans = (int) d + 1;
            return ans;
        } else {
            return run(k - (long) Math.pow(2, (int) d));
        }
    }
}

import java.util.*;
import java.lang.*;

public class P_743B{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();
    long k = sc.nextLong();
    int count = 1;

    while(k % 2 != 1){
      count++;
      k /= 2;
    }

    System.out.println(count);
  }
}

import java.io.*;

import java.util.*;

public class CF_A implements Runnable {

    private static final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;

    private BufferedReader in;
    private PrintWriter out;
    private StringTokenizer tok = new StringTokenizer("");

    private void init() throws FileNotFoundException {
        Locale.setDefault(Locale.US);
        String fileName = "";
        if (ONLINE_JUDGE && fileName.isEmpty()) {
            in = new BufferedReader(new InputStreamReader(System.in));
            out = new PrintWriter(System.out);
        } else {
            if (fileName.isEmpty()) {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            } else {
                in = new BufferedReader(new FileReader(fileName + ".in"));
                out = new PrintWriter(fileName + ".out");
            }
        }
    }

    String readString() {
        while (!tok.hasMoreTokens()) {
            try {
                tok = new StringTokenizer(in.readLine());
            } catch (Exception e) {
                return null;
            }
        }
        return tok.nextToken();
    }

    int readInt() {
        return Integer.parseInt(readString());
    }

    long readLong() {
        return Long.parseLong(readString());
    }

    double readDouble() {
        return Double.parseDouble(readString());
    }

    int[] readIntArray(int size) {
        int[] a = new int[size];
        for (int i = 0; i < size; i++) {
            a[i] = readInt();
        }
        return a;
    }

    public static void main(String[] args) {
        //new Thread(null, new _Solution(), "", 128 * (1L << 20)).start();
        new CF_A().run();
    }

    long timeBegin, timeEnd;

    void time() {
        timeEnd = System.currentTimeMillis();
        System.err.println("Time = " + (timeEnd - timeBegin));
    }

    @Override
    public void run() {
        try {
            timeBegin = System.currentTimeMillis();
            init();
            solve();
            out.close();
            time();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
    }

    void solve() throws IOException {
        long n = readLong();
        long m = readLong();

        for(int i = 1; i <= n; i++){
            if(((long)Math.pow(2,i-1) - m) % (long)Math.pow(2,i) == 0){
                out.print(i);
                break;
            }
        }

    }

}

import java.util.*;
public class bitmask_cf384_2_2 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong(),k=sc.nextLong(),count=0;
		while(n>0) {
			if(k%2 == 0) {
				k /= 2;
				count++;
			}
			else {
				break;
			}
			n--;
		}
		System.out.print(count+1);
	}

}

import java.util.Scanner;

/**
 * Created by Michal on 25.12.2016.
 */
public class CF389B {
    static long score(long k){
        long s=1;
        while (k % 2 == 0){
            s++;
            k/=2;
        }
        return s;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong(), k = sc.nextLong();
        System.out.println(score(k));
    }
}

import java.util.*;

public class B743 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner scan=new Scanner(System.in);

		int n=scan.nextInt();
		long k=scan.nextLong();

		long i;
		double f;
		i=k;
		f=k;

		int c=0;

		while(i==f){
			f/=2.0;
			i/=2;

			c++;
		}

	System.out.println(c);

	}

}

import java.util.Scanner;
import java.util.*;
import java.io.*;
import java.math.*;

//********************************************************K.S.J_@@@@@@@@@@@@@@@@@@@@@@@@@****************************

public class rev{
	static BufferedReader reader;
    static StringTokenizer tokenizer;

	static void init(InputStream input) {reader = new BufferedReader(new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }
	static String next() throws IOException {
        while (!tokenizer.hasMoreTokens() ) { tokenizer = new StringTokenizer(reader.readLine() );}
        return tokenizer.nextToken();
    }
	static String nextLine() throws IOException { return  next();}
	static int nextInt() throws IOException {return Integer.parseInt( next() );}
	static double nextDouble() throws IOException {return Double.parseDouble( next() );}
	static long nextLong() throws IOException {return Long.parseLong( next() );}
	static BigInteger nextBigInteger() throws IOException {return new BigInteger(next()) ;}

	public static void main(String args[]) throws IOException{
		init(System.in);
			int T=nextInt();
			long k=nextLong();
			long c=0;
				if(k%2==1){System.out.println("1");return ;}
				while(k>0 && k%2==0){k/=2;c++;}System.out.println(c+1);

			}

}

import java.util.*;
public class ladder {
    public static void main(String[] args) throws java.lang.Exception {

        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextInt();
        double k = scanner.nextDouble()-1;
        long mid =(long)((Math.pow(2, n)-1)/2);
        if(k==mid){
            System.out.println(n);
            return;
        }
        if(k>mid) k-=mid+1;
        long ret =1;
        long temp =mid;
        n--;
        for (int i = 0; mid!=0; i++) {
            mid/=2;
            if(mid==k){
                ret=n;
                break;
            }
            if(k>mid) k-=mid+1;
            n--;
        }
        System.out.println(ret);
    }
}

import java.lang.*;
import java.util.*;
public class Main{
	public static void main(String agrs[])
	{
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
		long k=in.nextLong();
		System.out.println(Long.numberOfTrailingZeros(k)+1);
	}
}

import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static PrintWriter out;

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt(); // step number
        long k = sc.nextLong(); // kth digit

        if (n== 0 || n==1) {
            out.println(1);
        } else {

            if (k % 2 == 1) {
                out.println(1);
            } else {

                long step = 2;
                long count = 3;
                while (step < (long) n) {
                    count = (count * 2) + 1;
                    step++;
                }

                long low = 1;
                long high = count;

                long middleVal = (long) n;
                while (low <= high) {
                    long middle = (long) Math.ceil(((double) (high - low) / (double) 2) + (double) low);
                    if (k < middle) {
                        high = middle - 1;
                        middleVal--;
                    } else if (k > middle) {
                        low = middle + 1;
                        middleVal--;
                    } else {
                        out.println(middleVal);
                        break;
                    }
                }
            }

        }
        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B {
	public static void main(String[] args) throws IOException{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String[] ns = bf.readLine().split(" ");
		int n = Integer.parseInt(ns[0]);
		long k = Integer.parseInt(ns[1]);
		long length = 1;
		for(int i = 1;i<n;i++){
			if(k<=length){
				for(i=i;true;i--){
					if(k==(length+1)/2){
						System.out.println(i);
						return;
					}
					else{
						long diff = length-k;
						length = (length-1)/2;
						if(k>length)
							k = length-diff;
					}
				}
			}

			length = 2*length+1;
		}
	}
}

import java.util.Scanner;

/**
 * Created by Luis Ngo on 22/12/2016.
 */
public class P743B {
    public static void main (String[] args){
        Scanner  scanner =  new Scanner(System.in);
        int n =  scanner.nextInt();
        double k = scanner.nextDouble()-1;

        double arrayLength = Math.pow(2,n)-1;
        double temp = 0;
        int count = 0;
        double start= 0;
        double end =  arrayLength;
        if (n==1) {
            System.out.println(1);
            return;
        }
        while (k != temp){
            temp = Math.floor((start +end)/2);
            if (k < temp){
                end =  temp;
            }else if (k > temp){
                start = temp;
            }
            count++;
        }
        System.out.println(n+1-count);
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

public class seq2 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA
    {
        public void solve(int testNumber, InputReader in, PrintWriter out)
        {
        	int n=in.nextInt();
        	int k=in.nextInt();
        	String s="1";
        	for(int i=0;i<n-1;i++)
        	{
        		String s2=s;
        		String s1=Integer.toString(i+2);
        		s=s.concat(s1);
        		s=s.concat(s2);
        	}
        	System.out.print(s.charAt(k-1));

        }

    }

    static long min2(long x,long y){return x<y?x:y;}
    static long min3(long x,long y,long z){return x<y?(x<z?x:z):(y<z?y:z);}
    static long min4(long n1,long n2,long n3,long n4){
    	return n1<n2?(n1<n3?(n1<n4?n1:n4):(n3<n4?n3:n4)):(n2<n3?(n2<n4?n2:n4):(n3<n4?n3:n4));}
    static long max2(long x,long y){return x>y?x:y;}
    static long max3(long x,long y,long z){return x>y?(x>z?x:z):(y>z?y:z);}
    static long max4(long n1,long n2,long n3,long n4){
    	return n1>n2?(n1>n3?(n1>n4?n1:n4):(n3>n4?n3:n4)):(n2>n3?(n2>n4?n2:n4):(n3>n4?n3:n4));}

    static long abs(long x)
    {
    	if(x<0)
    		return -x;
    	else
    		return x;
    }

    static int abs(int x)
    {
    	if(x<0)
    		return -x;
    	else
    		return x;
    }

    static long sumarr(int arr[],int n1,int n2)
    {
    	long sum=0;
    	for(int i=n1-1;i<n2;i++)
    	{
    		sum=sum+arr[i];
    	}
    	return sum;
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public String nextLine() {
			String fullLine=null;
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					fullLine=reader.readLine();
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
				return fullLine;
			}
			return fullLine;
		}

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
        	return Long.parseLong(next());
        }

        public double nextDouble() {
        	return Double.parseDouble(next());
        }

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong();
            long k = in.nextLong();
            long res = 0;

            if (k % 2 == 1) {
                res = 1;
            } else {
                while (k > 0) {
                    int m = twoPow(k);
                    if (k == (Math.pow(2L, m))) {
                        res = m + 1;
                        break;
                    }
                    k -= Math.pow(2L, m);
                }

            }
            out.println(res);
        }

        int twoPow(long k) {
            int res = 0;
            while (Math.pow(2L, res) < k) res++;
            return res;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.util.*;
import java.lang.*;
import java.io.*;
import java.awt.Point;

// SHIVAM GUPTA :
//NSIT
//decoder_1671
//BEING PERFECTIONIST IS NOT AN OPTION.
// STOP NOT TILL IT IS DONE OR U DIE .
//EITHER MAKE IT OR BREAK IT.
//NEVER UNDERESTIMATE URSELF.
// U KNOW THAT IF THIS DAY WILL BE URS THEN NO ONE CAN DEFEAT U
// REST ..HAVE FAITH ON DESTINY

// ASCII = 48 + i ;

// 2^28 = 268,435,456  > 10^8

// log 10 base 2 = 3.3219

// odd:: (x^2+1)/2 , (x^2-1)/2 ; x>=3

// even:: (x^2/4)+1 ,(x^2/4)-1  x >=4

/* Name of the class has to be "Main" only if the class is public. */

public class Main
{

    // static int[] arr = new int[100002] ;
    // static int[] dp = new int[100002] ;

    static PrintWriter out;

	static class FastReader{
		BufferedReader br;
		StringTokenizer st;
		public FastReader(){
			br=new BufferedReader(new InputStreamReader(System.in));
			out=new PrintWriter(System.out);
		}
		String next(){
			while(st==null || !st.hasMoreElements()){
				try{
					st= new StringTokenizer(br.readLine());
				}
				catch (IOException e){
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		long nextLong(){
			return Long.parseLong(next());
		}
		double nextDouble(){
			return Double.parseDouble(next());
		}
		String nextLine(){
			String str = "";
			try{
				str=br.readLine();
			}
			catch(IOException e){
				e.printStackTrace();
			}
			return str;
		}
	}

/////////////////////////////////////////////////////////////////////////////////////

public static int  min(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[0];

}

 /////////////////////////////////////////////////////////////////////////////

public static int  max(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[3];

}

///////////////////////////////////////////////////////////////////////////////////
static int sieve =  1000000 ;

static boolean[] prime =  new boolean[sieve + 1] ;

public static void sieveOfEratosthenes()
    {
        // FALSE == prime

        // TRUE ==  COMPOSITE

        // FALSE== 1

        // time complexity = 0(NlogLogN)== o(N)

        // gives prime nos bw 1 to N

        for(int i = 2; i<= sieve ; i++)
        {
            prime[i] = true  ;
            i++ ;
        }

        for(int p = 3; p*p <= sieve; p++)
        {

            if(prime[p] == false)
            {

                for(int i = p*p; i <= sieve; i += p)
                    prime[i] = true;
            }

            p++ ;
        }

    }

///////////////////////////////////////////////////////////////////////////////////

public static String reverse(String input)
{
    String op = "" ;

    for(int i = 0; i < input.length() ; i++ )
    {
        op = input.charAt(i)+  op ;
    }

return op ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static void sortD(int[] arr , int s  , int e)
{
      sort(arr ,s , e) ;

      int i =s ; int j = e  ;

      while( i < j)
      {
            int temp = arr[i] ;
            arr[i] =arr[j] ;
            arr[j] = temp ;
            i++ ; j-- ;
      }

      return ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(long a  ,long b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(int a  ,int b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

////////////////////////////////////////////////////////////////////////////////////

public static boolean isPossibleTriangle(int a  ,int b , int c)
{
      if( a + b > c && c+b > a && a +c > b)
      {
            return true  ;
      }

      return false  ;

}

/////////////////////////////////////////////////////////////////////////////////

public static long countSubarraysSumToK(long[] arr ,long sum )
    {
      HashMap<Long,Long> map = new HashMap<>() ;

      int n = arr.length ;

      long prefixsum = 0 ;

      long count = 0L ;
      for(int i  = 0; i < n ; i++)
      {
          prefixsum  = prefixsum +  arr[i] ;

          if(sum == prefixsum)count = count+1 ;

          if(map.containsKey(prefixsum -sum))
          {
              count = count + map.get(prefixsum -sum) ;
          }

          if(map.containsKey(prefixsum ))
          {
              map.put(prefixsum , map.get(prefixsum) +1 );
          }

          else{
              map.put(prefixsum , 1L );
          }

      }

      return count  ;

    }

///////////////////////////////////////////////////////////////////////////////////////

public static int gcd(int a, int b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

//////////////////////////////////////////////////////////////////////////////////
public static long gcd(long a, long b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c , int d )
{

int temp = lcm(a,b , c) ;

 int ans = lcm(temp ,d ) ;

return ans  ;

}

//////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c )
{

int temp = lcm(a,b) ;

int ans =  lcm(temp ,c) ;

return ans  ;

}

////////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a , int b )
{

int gc = gcd(a,b);

return (a*b)/gc ;

}

///////////////////////////////////////////////////////////////////////////////////

    // CALCULATE TOTIENT Fn FOR ALL VALUES FROM 1 TO n
    // TOTIENT(N) = count of nos less than n and grater than 1 whose gcd with n is 1
    // or n and the no  will be coprime in nature
    //time : O(n*(log(logn)))

    public static void eulerTotientFunction(int[] arr ,int n )
    {

      for(int i = 1; i <= n  ;i++)arr[i] =i  ;

      for(int i= 2 ; i<= n ;i++)
      {
          if(arr[i] == i)
          {
              arr[i] =i-1 ;

              for(int j =2*i ; j<= n  ; j+= i )
              {
                  arr[j] = (arr[j]*(i-1))/i ;
              }

          }
      }

      return  ;

    }

/////////////////////////////////////////////////////////////////////////////////////////////

static boolean isPrime(int n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(int i = 2; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}

static boolean isPrime(long n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(long i = 2L; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}
//////////////////////////////////////////////////////////////////////////////////////////
public static long nCr(int n,int k)
{
    long ans=1;
    k=k>n-k?n-k:k;
    int j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
///////////////////////////////////////////////////////////////////////////////////////////

public static ArrayList<Integer> allFactors(int n)
{
      ArrayList<Integer> list = new ArrayList<>() ;

    for(int i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

///////////////////////////////////////////////////////////////////////////

public static ArrayList<Long> allFactors(long n)
{
      ArrayList<Long> list = new ArrayList<>() ;

    for(long i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

/////////////////////////////////////////////////////////////////////////////

public static boolean isPowerOfTwo(int n)
{
    if(n==0)
    return false;

if(((n ) & (n-1)) == 0 ) return true ;
else return false  ;

}

////////////////////////////////////////////////////////////////////////////////////

    public static int countDigit(long n)
    {
        return (int)Math.floor(Math.log10(n) + 1);
    }

 /////////////////////////////////////////////////////////////////////////////////////////

 public static int sumOfDigits(long n)
 {

  if( n< 0)return -1 ;

  int sum = 0;

  while( n > 0)
  {
      sum = sum + (int)( n %10) ;

      n /= 10 ;
  }

  return sum ;

 }
 /////////////////////////////////////////////////////////////////////////////////////////

  static final int MAXN = 100001;

    static int spf[] = new int[MAXN];

    static void sieve()
    {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)

            spf[i] = i;

        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;

        for (int i=3; i*i<MAXN; i++)
        {

            if (spf[i] == i)
            {

                for (int j=i*i; j<MAXN; j+=i)

                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }

// The above code works well for n upto the order of 10^7.
// Beyond this we will face memory issues.

// Time Complexity: The precomputation for smallest prime factor is done in O(n log log n)
// using sieve.
// Where as in the calculation step we are dividing the number every time by
// the smallest prime number till it becomes 1.
// So, let’s consider a worst case in which every time the SPF is 2 .
// Therefore will have log n division steps.

// Hence, We can say that our Time Complexity will be O(log n) in worst case.

    static Vector<Integer> getFactorization(int x)
    {
        Vector<Integer> ret = new Vector<>();
        while (x != 1)
        {
            ret.add(spf[x]);
            x = x / spf[x];
        }
        return ret;
    }

  //////////////////////////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////////////////////////

public static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int[n1];
        int R[] = new int[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
  public static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
public static void sort(long arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

public static void merge(long arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        long L[] = new long[n1];
        long R[] = new long[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

 /////////////////////////////////////////////////////////////////////////////////////////

	public static long knapsack(int[] weight,long value[],int maxWeight){

        int n=  value.length ;

	//dp[i] stores the profit with KnapSack capacity "i"
  long []dp = new long[maxWeight+1];

    //initially profit with 0 to W KnapSack capacity is 0
    Arrays.fill(dp, 0);

    // iterate through all items
    for(int i=0; i < n; i++)

        //traverse dp array from right to left
        for(int j = maxWeight; j >= weight[i]; j--)
            dp[j] = Math.max(dp[j] , value[i] + dp[j - weight[i]]);

    /*above line finds out maximum of dp[j](excluding ith element value)
    and val[i] + dp[j-wt[i]] (including ith element value and the
    profit with "KnapSack capacity - ith element weight") */
    return dp[maxWeight];
	}

///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////

// to return max sum of any subarray in given array
public static long kadanesAlgorithm(long[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}
/////////////////////////////////////////////////////////////////////////////////////////////
public static long kadanesAlgorithm(int[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}

///////////////////////////////////////////////////////////////////////////////////////

// Arrays.sort(arr, new Comparator<Pair>() {
// 			@Override
// 			public int compare(Pair first, Pa second) {
// 				if (first.getAge() != second.getAge()) {
// 					return first.getAge() - second.getAge();
// 				}
// 				return first.getName().compareTo(second.getName());
// 			}
// 		});

/////////////////////////////////////////////////////////////////////////////////////////

public static long binarySerachGreater(int[] arr , int start , int end , int val)
{

      // fing total no of elements strictly grater than val in sorted array arr

      if(start >  end)return  0 ; //Base case

      int mid = (start + end)/2  ;

      if(arr[mid] <=val)
      {
          return binarySerachGreater(arr,mid+1, end ,val) ;

      }
      else{

         return binarySerachGreater(arr,start , mid -1,val) + end-mid+1 ;

      }

}

//////////////////////////////////////////////////////////////////////////////////

//TO GENERATE ALL(DUPLICATE ALSO EXIST) PERMUTATIONS OF A STRING

//Function for swapping the characters at position I with character at position j
    public static String swapString(String a, int i, int j) {
        char[] b =a.toCharArray();
        char ch;
        ch = b[i];
        b[i] = b[j];
        b[j] = ch;
        return String.valueOf(b);
    }

//Function for generating different permutations of the string
    public static void generatePermutation(String str, int start, int end)
    {
        //Prints the permutations
        if (start == end-1)
            System.out.println(str);
        else
        {
            for (int i = start; i < end; i++)
            {
                //Swapping the string by fixing a character
                str = swapString(str,start,i);
                //Recursively calling function generatePermutation() for rest of the characters
                generatePermutation(str,start+1,end);
                //Backtracking and swapping the characters again.
                str = swapString(str,start,i);
            }
        }
    }

// JUST CALL generatePermutation( str,  start,  end) start :inclusive ,end : exclusive

////////////////////////////////////////////////////////////////////////////////////

public static long arraySum(int[] arr , int start , int end)
{
    long ans = 0 ;

    for(int i = start ; i <= end  ; i++)ans += arr[i] ;

    return ans  ;
}

/////////////////////////////////////////////////////////////////////////////////

public static int mod(int x)
{
      if(x <0)return -1*x ;
      else return x ;
}
public static long mod(long x)
{
      if(x <0)return -1*x ;
      else return x ;
}

////////////////////////////////////////////////////////////////////////////////

public static void swapArray(int[] arr , int start , int end)
{
    while(start < end)
    {
        int temp = arr[start] ;
        arr[start] = arr[end];
        arr[end] = temp;
        start++ ;end-- ;
    }
}

//////////////////////////////////////////////////////////////////////////////////

public static long factMod(long n, long mod) {
    if (n <= 1) return 1;
    long ans = 1;
    for (int i = 1; i <= n; i++) {
      ans = (ans * i) % mod;
    }
    return ans;
  }

/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
public static long power(int x  ,int n)
    {
        //time comp : o(logn)

        if(n==0)return 1 ;
        if(n==1)return x;

        long ans =1  ;

      while(n>0)
      {
          if(n % 2 ==1)
          {
              ans = ans *x ;
          }

          n /= 2 ;

          x =  x*x ;

      }

      return ans ;
    }

////////////////////////////////////////////////////////////////////////////////////////////////////
public static long powerMod(long x, long n, long mod) {
    //time comp : o(logn)

    if(n==0)return 1L ;
        if(n==1)return x;

    long ans = 1;
    while (n > 0) {
      if (n % 2 == 1) ans = (ans * x) % mod;
      x = (x * x) % mod;
      n /= 2;
    }
    return ans;
  }

//////////////////////////////////////////////////////////////////////////////////

public static int[][] rotate(int[][] input){

int n =input.length;
int m = input[0].length ;
int[][] output = new int [m][n];

for (int i=0; i<n; i++)
	for (int j=0;j<m; j++)
		output [j][n-1-i] = input[i][j];
return output;
}

//////////////////////////////////////////////////////////////////////////////////

/*
lowerBound - finds largest element equal or less than value paased
upperBound - finds smallest element equal or more than value passed

if not present return -1;

*/

public static long lowerBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static int lowerBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static long upperBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

	public static int upperBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

/////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////

public static void solve()
{
FastReader scn = new FastReader() ;

//ArrayList<Integer> list = new ArrayList<>() ;
ArrayList<Long> list = new ArrayList<>() ;
ArrayList<Integer> lista = new ArrayList<>() ;
ArrayList<Integer> listb = new ArrayList<>() ;

//HashMap<Integer,Integer> map = new HashMap<>() ;
HashMap<Long,Integer> map = new HashMap<>() ;
HashMap<Integer,Integer> map1  = new HashMap<>() ;
HashMap<Integer,Integer> map2  = new HashMap<>() ;
//HashMap<Point,> point = new HashMap<>() ;

//int[] store = {2 ,3, 5 , 7  ,11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 } ;

// product of first 11 prime nos is gre ater than 10 ^ 12;

//HashMap<String,Integer> maps = new HashMap<>() ;
//HashMap<Integer,Boolean> mapb = new HashMap<>() ;

//if(map.containsKey(arr[i]))map.put(arr[i] , map.get(arr[i]) +1 ) ;
//else map.put(arr[i],1) ;

// if(map.containsKey(temp))map.put(temp , map.get(temp) +1 ) ;
// else map.put(temp,1) ;

Set<Integer> set = new HashSet<>() ;
//Set<Integer> sety = new HashSet<>() ;

int t = 1;
// t = scn.nextInt() ;

while(t-- > 0)
{

 //String str  = scn.next() ;
 //long n = scn.nextLong() ;
  //long k = scn.nextLong() ;

 //int n = scn.nextInt() ;
 //int m = scn.nextInt() ;
//int k = scn.nextInt() ;
// int x  = scn.nextInt() ;
// int y = scn.nextInt() ;
 //int a = scn.nextInt() ;
//long a = scn.nextLong() ;
 //int b = scn.nextInt() ;
//long b = scn.nextLong() ;
 //int c = scn.nextInt() ;
// int d = scn.nextInt() ;

long n = scn.nextLong() ;

long k = scn.nextLong() ;

long ans = n ;

long start =1L ;
long end = (1<<n) -1L;

while(start <= end)
{
    long mid  =(start +end)/2L ;

    if(mid == k)
    {
      break ;
    }

    else if( mid > k)
    {

        end = mid-1 ;
         ans-- ;

    }

    else{

        start = mid+1;
        ans-- ;

    }

}

out.println(ans) ;

//for(int i = 0; i < n; i++)out.print(arr[i]+ " ") ;

//out.println() ;

list.clear() ;
map.clear() ;
map1.clear() ;
map2.clear() ;
set.clear() ;
} // test case  end loop

out.flush() ;
}

public static void main (String[] args) throws java.lang.Exception
{

solve() ;

}

}

 class Pair
{
  int first ;

  int second  ;

@Override
	public String toString() {

	String ans = "" ;
	ans  += this.first ;
	ans += " ";
	ans += this.second ;

	return ans  ;
	}

}

import java.io.*;
import java.util.*;

public class spoj
{
	static class FastReader
	{
		BufferedReader br;
		StringTokenizer st;

		public FastReader()
		{
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next()
		{
			while(st==null || !st.hasMoreElements())
			{
				try
				{
					st = new StringTokenizer(br.readLine());
				}
				catch(IOException e)
				{
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt()
		{
			return Integer.parseInt(next());
		}

		long nextLong()
		{
			return Long.parseLong(next());
		}

		double nextDouble()
		{
			return Double.parseDouble(next());
		}

		String nextLine()
		{
			String str="";
			try
			{
				str = br.readLine();
			}
			catch(IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
	}

	public static void main(String args[]) throws IOException
	{
		FastReader fr = new FastReader();
		long low=0L,high=1L,mid,m;
		long n = fr.nextLong();
		long k = fr.nextLong();
		k--;
		if(k==(Math.pow(2,n)-1)/2)
		{
			System.out.println(n);
		}
		else if(k%2==0)
		{
			System.out.println(1);
		}
		else
		{
			while(low<high)
			{
				low = 0L;
				high = (long)Math.pow(2,n)-1;
				mid  = (low+high)/2;
				if(k>mid)
				{
					low = mid + 1;
				}
				else if(k<mid)
				{
					high = mid;
				}
				else
				{
					break;
				}
				n--;
			}
			System.out.println(n);
		}

 	}
}

import java.io.*;
import java.util.*;
public class div384B
{
	BufferedReader in;
	PrintWriter ob;
	StringTokenizer st;
	public static void main(String[] args) throws IOException {
		new div384B().run();
	}
	void run() throws IOException {
		//in=new BufferedReader(new FileReader("input.txt"));
		in=new BufferedReader(new InputStreamReader(System.in));
		ob=new PrintWriter(System.out);
		solve();
		ob.flush();
	}
	void solve() throws IOException {
		int n=ni();
		int k=ni();
		if(k%2==1) {
			ob.println("1");
			return;
		}
		long ans=-1;
		long low=1;
		long high=(long)(Math.pow(2,k))-1;
		long ss=get(low , high);
		while(low<=high) {
			long mid=low + (high-low)/2;
			if(ans==-1) {
				ans=ss;
			}
			else
				--ans;
			if(mid==k)
				break;
			if(mid<k) {
				low=mid;
			}
			else
				high=mid;
		}
		ob.println(ans);
	}
	long get(long x , long y) {
		long p = (x+y)/2;
		long res=0;
		while(p>0) {
			p/=2;
			res++;
		}
		return res;
	}
	String ns() throws IOException {
		return nextToken();
	}
	long nl() throws IOException {
		return Long.parseLong(nextToken());
	}
	int ni() throws IOException {
		return Integer.parseInt(nextToken());
	}
	double nd() throws IOException {
		return Double.parseDouble(nextToken());
	}
	String nextToken() throws IOException {
		if(st==null || !st.hasMoreTokens())
			st=new StringTokenizer(in.readLine());
		return st.nextToken();
	}
	int[] nia(int start,int b) throws IOException {
		int a[]=new int[b];
		for(int i=start;i<b;i++)
			a[i]=ni();
		return a;
	}
	long[] nla(int start,int n) throws IOException {
		long a[]=new long[n];
		for (int i=start; i<n ;i++ ) {
			a[i]=nl();
		}
		return a;
	}
}

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

/**
 * @author maxkrivich
 */
public final class Main {
    private void solve() {
        int n = in.nextInt();
        long k = in.nextLong();
        long x = 1 << 50;
        int z=0;
        for (long i=1;i<x;i*=2){
            if (k%i*2==i){
                out.print(z);
            }
            z++;
        }
    }

    //    -------------I/O-------------    \\
    void run() {
        try {
            in = new FScanner(new File("input.txt"));
            out = new PrintWriter(new BufferedWriter(new FileWriter(new File("output.txt"))));
            solve();
            out.close();
            in.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    void runIO() {
        in = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
        in.close();
    }

    public static void main(String[] args) {
        new Main().runIO();
    }

    private FScanner in;
    private PrintWriter out;

    class FScanner {

        private BufferedReader br;
        private StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            }
        }

        void useString(String s) {
            if (s != null) {
                st = new StringTokenizer(s);
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }

        void close() {
            try {
                br.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
}

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
import java.util.StringTokenizer;

public class codeforces {

    public static int Binary(int x,int array[]){
        int min=0;
        int max=array.length-1;
        int mid=0;
        while(min<max){
            mid=(max+min)/2;
            if (array[mid]==x)return mid;
            if (x>array[mid])min=mid+1;
            if (x<array[mid])max=mid-1;

        }

    return 0;}

    public static void main(String[] args) throws IOException {
        Reader.init(System.in);
        PrintWriter pw=new PrintWriter(System.out);
       int n=Reader.nextInt()-2,index=Reader.nextInt(),length=3;

        for (int i = 1; i <= n; i++)
            length=length*2+1;

       if(index%2!=0)pw.println(1);
       else if ((index)==length/2+1)pw.println(n+2);

       else{ if(index<=length/2 ){
       int i=2,answer=2;
       while(i<=index && (i+1)<=index)
       {
           i*=2;answer++;}
       pw.println(answer);}
       else {int i=length/2+2,answer=2;

       while(i<=index && (i+1)<=index){i*=2;answer++;}

      pw.println(answer); }}

        pw.close();

    }

    }

 class Reader {

        static BufferedReader reader;
        static StringTokenizer tokenizer;

        public static int pars(String x) {
            int num = 0;
            int i = 0;
            if (x.charAt(0) == '-') {
                i = 1;
            }
            for (; i < x.length(); i++) {
                num = num * 10 + (x.charAt(i) - '0');
            }

            if (x.charAt(0) == '-') {
                return -num;
            }

            return num;
        }

        static void init(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer("");
        }

        static void init(FileReader input) {
            reader = new BufferedReader(input);
            tokenizer = new StringTokenizer("");
        }

        static String next() throws IOException {
            while (!tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(
                        reader.readLine());
            }
            return tokenizer.nextToken();
        }

        static int nextInt() throws IOException {
            return pars(next());
        }

        static long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        static double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }
    }

import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long k = scanner.nextLong();
        int number = 0;
        if (k % 2 != 0) {
            number = 1;
        } else {
            for (int i = 2; i <= n; i++) {
                double lastPosition = Math.pow(2, i - 1);
                if (k == lastPosition) {
                    number = i;
                    break;
                }
                for (int j = 1; j <= n; j++) {
                    double latestPos = lastPosition + Math.pow(2, i);
                    if (k == latestPos) {
                        number = i;
                        break;
                    } else {
                        lastPosition = latestPos;
                    }
                }
                if (number != 0) break;
            }
        }
        System.out.print(number);
    }
}

import java.util.Scanner;

/**
 * Created by Michal on 25.12.2016.
 */
public class CF389B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), k = sc.nextInt(), h=0, d=1, o = 3;
        int[] tab = new int[(int) Math.pow(2, n)-1];
        for (int i = 0; i < tab.length; i++) {
            tab[i] = d++;
            h++;
            if (h % 2 != 0){
                tab[i] = 1;
            }
            if (h % 2 == 0 && i > 1) {
                tab[i] = (tab[i - 2] == 2 ? o++ : 2);
            }
            if (tab[i] > n) {
                o = n;
                if (h % 2 == 0 && i > 1) {
                    tab[i] = (tab[i - 2] == 2 ? o-1 : 2);
                }
            }
        }
        System.out.println(tab[k-1]);
    }
}

import java.io.*;
import java.util.*;

public class Stack {
    public static void main(String[] args) throws IOException {
        BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(r.readLine());
        int n=Integer.parseInt(in.nextToken());
        long k=Long.parseLong(in.nextToken());

        long ns[]=new long [n+1];

        for(int i=0;i<n+1;i++){
            ns[i]=(long)Math.pow(2, i)-1;
        }
        while(true){
        int p=Arrays.binarySearch(ns, k-1);

        if (p>=0){
            System.out.println(p+1);
            break;
        }
        else{
            p=(-1*p)-1;
            k-=ns[p-1];
        }
        }
    }}

import java.util.*;

public class B {
public static void main (String [] args)
{
  Scanner scan = new Scanner(System.in);
  int n = scan.nextInt();
  int a = scan.nextInt();
  System.out.println(fun(n,a));
}
public static String fun(int a,int b){
  String res = "";
  for(int i=1;i<=a;i++){
    res = res + i + res;
  }
  return res.charAt(b-1)+"";
}
}

/**
 * Created by ankeet on 12/14/16.
 */
import java.io.*;
import java.util.*;

public class B743 {

    static FastReader in = null;
    static PrintWriter out = null;

    public static long ans(long n, long k){
        if(k==1) return 1;

        long len = (1<<n) - 1;
        long plen = (1<<(n-1)) - 1;
        if(k == plen+1) return n;
        if(k <= plen) return ans(n-1, k);
        return ans(n-1, k - plen - 1);
    }

    public static void solve()
    {
        long n = in.nextLong();
        long k = in.nextLong();
        out.println(ans(n,k));
    }

    public static void main(String[] args)
    {
        in = new FastReader(System.in);
        out = new PrintWriter(System.out);
        solve();
        out.flush();
        out.close();

    }

    static class FastReader {

        BufferedReader read;
        StringTokenizer tokenizer;

        public FastReader(InputStream in)
        {
            read = new BufferedReader(new InputStreamReader(in));
        }

        public String next()
        {
            while(tokenizer == null || !tokenizer.hasMoreTokens())
            {
                try{
                    tokenizer = new StringTokenizer(read.readLine());
                }catch(Exception e){
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public String nextLine(){

            try
            {
                return read.readLine();
            }
            catch(Exception e)
            {
                throw new RuntimeException(e);
            }
        }
        public int nextInt()
        {
            return Integer.parseInt(next());
        }
        public long nextLong()
        {
            return Long.parseLong(next());
        }
        public double nextDouble()
        {
            return Double.parseDouble(next());
        }

        public int[] nextIntArr(int n)
        {
            int[] a = new int[n];
            for(int i=0; i<n; ++i)
            {
                a[i] = nextInt();
            }
            return a;
        }

        public long[] nextLongArr(int n)
        {
            long[] a = new long[n];
            for(int i=0; i<n; ++i)
            {
                a[i] = nextLong();
            }
            return a;
        }
    }

}

import java.util.*;
import java.io.*;
import java.math.*;
public class HEPractice{
	static long mod=(long)Math.pow(10,9)+7;
	public static void main(String[] args){
		InputReader in = new InputReader(System.in);
        PrintWriter w = new PrintWriter(System.out);
        int n=in.nextInt();
        long k=in.nextLong();
        w.println(calculate(k-1,n));
        w.close();
	}
	static int calculate(long given,int n){
		for(int j=1;j<=n;j++){
			for(int k=1;k<=n;k++){
				long num=(long)Math.pow(2, j-1)+((long)(Math.pow(2, j)))*(k-1)-(long)1;
				if((long)(Math.pow(2, n+1)-(long)1)<num){
					break;
				}
				//System.out.println(num);
				if(num==given){
					return j;
				}
			}
		}
		return 0;
	}
	static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar, numChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextLine() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isEndOfLine(c));
            return res.toString();
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextInt();
            }
            return arr;
        }

        public long[] nextLongArray(int n) {
            long[] arr = new long[n];
            for (int i = 0; i < n; i++) {
                arr[i] = nextLong();
            }
            return arr;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        private boolean isEndOfLine(int c) {
            return c == '\n' || c == '\r' || c == -1;
        }
        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), m = in.nextInt();
            String s = "1";
            int cnt = 2, l = 1;
            for (int i = 0; i < n - 1; i++) {
                String t = s.substring(0, l);
                s += String.valueOf(cnt) + t;
                cnt++;
                l = s.length();
            }
            out.println(s.charAt(m - 1));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.Vector;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main implements Runnable{

		static {

		}

		 public static void main(String[] args) throws IOException {
			new Thread(null , new Main(),"Main", 1<<26).start();

		 }

		public void run(){
			try {
			PrintWriter out = new PrintWriter(System.out);
			MyScanner sc = new MyScanner();
			solve(out, sc);
			out.close();
			}
			catch (Exception e) {
				e.printStackTrace();

			}
		}
		void solve(PrintWriter out, MyScanner sc){

			int n = sc.nextInt();
			long k = sc.nextLong() - 1;
			long len = (long)(1 << n ) - 1;
			while(n-- > 0) {
				long mid = (len / 2);
				if(mid == k) {
					out.println(n + 1);
					break;
				}else if(k > mid){

					k = k - mid - 1;

				}
				len /= 2;
			}

		}

class MyScanner {
    BufferedReader br;
    StringTokenizer st;

    public MyScanner() {
       br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine(){
        String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
    }

 }
}

import java.io.IOException;
import java.util.Scanner;

public class ProblemB {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) throws IOException {
		int n  = sc.nextInt() , k = sc.nextInt() , counter = 2  ;

		StringBuilder sb = new  StringBuilder() ;
		sb.append(1);
		while(counter<=n){
			String s = sb.toString() ;
			sb.append(counter);
			sb.append(s) ;
			counter++ ;
		}
		System.out.println(sb.toString().charAt(k-1));
	}
}

import java.util.*;

public class qb{

	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int n = s.nextInt();
		int k = s.nextInt();
		String str = "1";
		int min = 1;
		int i = 1;
		while(i<n){
			String temp = str;
			str = str.concat(Integer.toString(min+1));
			str = str.concat(temp);
			min++;
			i++;
		}
		System.out.println(str.charAt(k-1));
	}

}

import java.io.*;
import java.util.*;

public class Stack {
    public static void main(String[] args) throws IOException {
        BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(r.readLine());
        int n=Integer.parseInt(in.nextToken());
        long k=Long.parseLong(in.nextToken());

        long ns[]=new long [n+1];
        if(k%2==1)System.out.println(1);
        else{
        for(int i=0;i<n+1;i++){
            ns[i]=(long)Math.pow(2, i)-1;
        }
        while(true){
        int p=Arrays.binarySearch(ns, k-1);

        if (p>=0){
            System.out.println(p+1);
            break;
        }
        else{
            p=(-1*p)-1;
            k-=ns[p-1];
        }
        }}
    }}

import java.util.*;

public class bucky{

public static void main (String args[]) {

Scanner input=new Scanner(System.in);

HashMap<Long, Integer> map1= new HashMap<Long, Integer>();
HashMap<Integer, Integer> map2= new HashMap<Integer, Integer>();
HashMap<Integer, Integer> linieleft= new HashMap<Integer, Integer>();
HashMap<Integer, Integer> linieright= new HashMap<Integer, Integer>();

			int n=input.nextInt();
			int k=input.nextInt();

		String str="1";
		String trans="";

		 for(int i=2;i<=n;i++){

		 trans=String.valueOf(i);
		 str=str+trans+str;

		 }
	//	  System.out.println(str);
		 System.out.println(str.substring(k-1,k));

		}

		}

import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static PrintWriter out;

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt(); // step number
        long k = sc.nextLong(); // ith digit

        if (n==0 || n==1) {
            out.println(1);
            return;
        }
        if (k % 2 == 1) {
            out.println(1);
        } else {
            long step = 2;
            long count = 3;
            while (step < (long)n) {
                count = (count * 2) + 1;
                step++;
            }

            long low = 1;
            long high = count;

            long middleVal = (long) n;
            while (low <= high) {
                //out.println("low: " + low + " high: " + high);
                long middle = (long) Math.ceil(((double)(high - low)/(double)2) + (double)low);

                //out.println(middle);
                if (k < middle) {
                    high = middle-1;
                    middleVal--;
                } else if (k > middle) {
                    low = middle;
                    middleVal--;
                } else {
                    out.println(middleVal);
                    break;
                }
            }

        }
        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

import java.math.BigInteger;
import java.util.*;

public class Core {

    public static void main(String [] args) {
        Scanner in = new Scanner(System.in);

        int n=in.nextInt();
        long k = in.nextLong();
        if(k%2==1){
            System.out.println(1);
            return;
        }
        long size = (1<<n)-1;
        if(k>size/2+1){
            k = (size/2+1)-(k-size/2-1);
        }
        if((k&(k-1))==0){
            System.out.println((int)(Math.log(k)/Math.log(2))+1);
        }
        else
            System.out.println(2);

        in.close();
    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author P Marecki
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        int go(int n, long k) {
            if (n == 1) return 1;
            long mid = (1 << (n - 1)) - 1;
            if (k == mid) return n;
            if (k > mid) k -= mid;
            return go(n - 1, k);
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextInt() - 1;
            out.println(go(n, k));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

//package ir.jalambadani.app.java.raspberry;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws InterruptedException {
        new Solve().run();
    }

    private static class Solve {

        private final Scanner inp;

        public Solve(){
            inp = new Scanner(System.in);

        }

        int pos = 0;
        public void run() {
           long n , k;

            n = inp.nextLong();
            k = inp.nextLong();

            long ans = 1;
            for(long i = 1 ; i < n+1 ; ++i) {
                long a = 1 << (i - 1);
                long b = 1 << i;

                if( (k - a) % b == 0){
                    System.out.println(i);
                    break;
                }
            }

        }

    }
}

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class QueB {
	public static void main(String[] args)throws Exception {
		// TODO Auto-generated method stub
		  BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
	        PrintWriter out=new PrintWriter(System.out);
	        String[] aa=in.readLine().split(" ");
	        int n=Integer.parseInt(aa[0]),k=Integer.parseInt(aa[1]);
	        int counter=2;
	        String pre="1";
	        for(int i=0;i<n-1;i++){
	        	pre=pre+counter+pre;
	        	counter++;
	        }
	     //   System.out.println(pre+" "+k);

	        out.println(pre.charAt(k-1));
	        out.close();
	}
}

import java.util.*;

public class CodeForces743B{
	public static void main(String[] args) {
		Scanner input = new Scanner(System.in);
		int n = input.nextInt();
		int k = input.nextInt();
		String x = "121x";
		int index = k%4;
		if(index == 0){
			int ans = k/4;
			System.out.println(2+ans);
		}
		else{
			System.out.println(x.charAt(index-1));
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task10 solver = new Task10();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task10 {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextLong();
            long sz = 1;
            for (int i = 1; i < n; i++) {
                sz = 2L * sz + 1L;
            }
//        out.println(sz);
            out.println(search(1L, sz, k, n));
        }

        public long search(long l, long r, long k, long n) {
            long mid = l + (r - l) / 2L;
            if (mid < k) {
                search(mid + 1, r, k, n - 1);
            } else if (mid > k) {
                search(l, mid - 1, k, n - 1);
            } else {
//            System.out.println(1111);
                return n;
            }
            return n - 1;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong();
            long k = in.nextLong();
            long res = 0;

            if (k % 2 == 1) {
                res = 1;
            } else {
                while (k > 0) {
                    int m = twoPow(k);
                    if (k == (Math.pow(2L, m))) {
                        res = m + 1;
                        break;
                    }
                    k -= Math.pow(2L, m);
                }

            }
            out.println(res);
        }

        int twoPow(long k) {
            int res = 0;
            while (Math.pow(2L, res) < k) res++;
            return res;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.util.*;

public class B {
public static void main (String [] args)
{
  Scanner scan = new Scanner(System.in);
  int n = scan.nextInt();
  int a = scan.nextInt();
  System.out.println(fun(n,a));
}
public static String fun(int a,int b){
  String res = "1";
  for(int i=2;i<=a;i++){
    res = res + i + res;
  }
  return res.charAt(b-1)+"";
}
}

import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static PrintWriter out;

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt(); // step number
        int k = sc.nextInt(); // ith digit

        if (k % 2 == 1) {
            out.println(1);
        } else {
            int step = 2;
            int count = 3;
            while (step < n) {
                count = (count * 2) + 1;
                step++;
            }

            int low = 1;
            int high = count;

            int middleVal = n;
            while (low < high) {
                //out.println("low: " + low + " high: " + high);
                int middle = (int) Math.ceil((low + high)/2);
                if (k < middle) {
                    high = middle-1;
                    middleVal--;
                } else if (k > middle) {
                    low = middle;
                    middleVal--;
                } else {
                    out.println(middleVal);
                    break;
                }
            }

        }
        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

import java.util.Scanner;

/**
 * Created by Luis Ngo on 22/12/2016.
 */
public class P743B {
    public static void main (String[] args){
        Scanner  scanner =  new Scanner(System.in);
        int n =  scanner.nextInt();
        double k = scanner.nextDouble()-1;

        double arrayLength = Math.pow(2,n)-1;
        double temp = 0;
        int count = 0;
        double start= 0;
        double end =  arrayLength;
        if (n==1) {
            System.out.println(1);
            return;
        }
        while (k != temp){
            temp = Math.floor((start +end)/2);
            if (k < temp){
                end =  temp;
            }else if (k > temp){
                start = temp;
            }
            count++;
        }
        System.out.println(n+1-count);
    }
}

import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class B384{

	void solve()
	{
		int n = ni();
		int k = ni();
		int cn = 1;
		while(k!=0)
		{
			if((k&1)==1)
			{
				System.out.println(cn);
				return;
			}
			else
			{
				cn++;
				k>>=1;
			}
		}
	}

	public static void main(String[] args){new B384().solve();}

	private byte[] bufferArray = new byte[1024];
	private int bufLength = 0;
	private int bufCurrent = 0;
	InputStream inputStream = System.in;

	int nextByte()
	{
		if(bufLength==-1)
			throw new InputMismatchException();
		if(bufCurrent>=bufLength)
		{
			bufCurrent = 0;
			try
			{bufLength = inputStream.read(bufferArray);}
			catch(IOException e)
			{ throw new InputMismatchException();}
			if(bufLength<=0)
				return -1;
		}
		return bufferArray[bufCurrent++];
	}

	boolean isSpaceChar(int x)
	{return (x<33 || x>126);}

	boolean isDigit(int x)
	{return (x>='0' && x<='9');}

	int nextNonSpace()
	{
		int x;
		while((x=nextByte())!=-1 && isSpaceChar(x));
		return x;
	}

	int ni()
	{
		int ans = 0;
		int sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	long nl()
	{
		long ans = 0;
		long sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	String ns()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(!isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	String nL()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(x==32 || !isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	char nc()
	{ return (char)nextNonSpace();}

	double nd()
	{ return (double)Double.parseDouble(ns()); }

	char[] ca()
	{ return ns().toCharArray();}

	char[] ca(int n)
	{
		char[] ans = new char[n];
		int p =0;
		int x = nextNonSpace();
		while(p<n)
		{
			ans[p++] = (char)x;
			x = nextByte();
		}
		return ans;
	}

	int[] ia(int n)
	{
		int[] ans = new int[n];
		for(int i=0;i<n;i++)
			ans[i]=ni();
		return ans;
	}

	long[] la(int n)
	{
		long[] ans = new long[n];
		for(int i=0;i<n;i++)
			ans[i] = nl();
		return ans;
	}

}

import java.util.*;
import java.lang.*;
import java.io.*;

public class Checker
{
	static int imax=Integer.MAX_VALUE,imin=Integer.MIN_VALUE;
	static long lmax=Long.MAX_VALUE,lmin=Long.MIN_VALUE;
	static long mod=(long)1e9+7;
	public static void main (String[] args) throws java.lang.Exception
	{
		InputReader in =new InputReader(System.in);
		PrintWriter out=new PrintWriter(System.out);
//		int test=in.nextInt();
 		int test=1;
 		int i=0,j=0;
		while(test-->0){
			int n=in.nextInt();
			int k=in.nextInt();
			for(i=1;i<=50;i++){
				if((k-(int)Math.pow(2,i-1))%Math.pow(2,i)==0){
					System.out.println(i);
					return;
				}
			}

			out.println();
		}
	out.close();
	}

	static void print(long arr[],int len){
		for(int i=0;i<len;i++)
		System.out.print(arr[i]+" ");
		System.out.println();
	}
	static class InputReader
	{

	    private InputStream stream;
	    private byte[] buf = new byte[1024];
	    private int curChar;
	    private int numChars;

	    public InputReader(InputStream stream) {
	        this.stream = stream;
	    }

	    public int read() {
	        if (numChars == -1)
	            throw new InputMismatchException();
	        if (curChar >= numChars) {
	            curChar = 0;
	            try {
	                numChars = stream.read(buf);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	            if (numChars <= 0)
	                return -1;
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() {
	        int c = read();
	        while (isSpaceChar(c))
	            c = read();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = read();
	        }
	        int res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c & 15;
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong() {
	        int c = read();
	        while (isSpaceChar(c))
	            c = read();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = read();
	        }
	        long res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c & 15;
	            c = read();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public String next() {
	        int c = read();
	        while (isSpaceChar(c))
	            c = read();
	        StringBuilder res = new StringBuilder();
	        do {
	            res.appendCodePoint(c);
	            c = read();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    public String nextLine() {
	        int c = read();
	        //while (c != '\n' && c != '\r' && c != '\t' && c != -1)
	        //c = read();
	        StringBuilder res = new StringBuilder();
	        do {
	            res.appendCodePoint(c);
	            c = read();
	        } while (c != '\n' && c != '\r' && c != '\t' && c != -1);
	        return res.toString();
	    }

	    public static boolean isSpaceChar(int c) {
	        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }

	}

}

import java.io.PrintWriter;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.Vector;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main implements Runnable{

		static {

		}

		 public static void main(String[] args) throws IOException {
			new Thread(null , new Main(),"Main", 1<<26).start();

		 }

		public void run(){
			try {
			PrintWriter out = new PrintWriter(System.out);
			MyScanner sc = new MyScanner();
			solve(out, sc);
			out.close();
			}
			catch (Exception e) {
				e.printStackTrace();

			}
		}
		void solve(PrintWriter out, MyScanner sc){

			int n = sc.nextInt();
			long k = sc.nextLong() - 1;
			long len = (long)(1 << n ) - 1;
			while(n >= 1) {
				long mid = (len / 2);
				//out.println(mid);
				//out.println(k);
				if(mid == k) {
					out.println(n);
					break;
				}else if (k < mid){
					len /= 2;
					n--;
				}else {
					len /= 2;
					k = k - mid - 1;
					n--;
				}
			}

		}

class MyScanner {
    BufferedReader br;
    StringTokenizer st;

    public MyScanner() {
       br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    String nextLine(){
        String str = "";
	  try {
	     str = br.readLine();
	  } catch (IOException e) {
	     e.printStackTrace();
	  }
	  return str;
    }

 }
}

import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static PrintWriter out;

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt(); // step number
        long k = sc.nextLong(); // ith digit

        if (n==0 || n==1) {
            out.println(1);
            return;
        }

            long step = 2;
            long count = 3;
            while (step < (long)n) {
                count = (count * 2) + 1;
                step++;
            }

            long low = 1;
            long high = count;

            long middleVal = (long) n;
            while (low < high) {
                //out.println("low: " + low + " high: " + high);
                long middle = (long) Math.ceil(((double)(high - low)/(double)2) + (double)low);

                //out.println(middle);
                if (k < middle) {
                    high = middle-1;
                    middleVal--;
                } else if (k > middle) {
                    low = middle+1;
                    middleVal--;
                } else {
                    out.println(middleVal);
                    break;
                }
            }

        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

import java.util.*;
public class ChloeAndTheSequence {
    public static void main(String args[]){
        Scanner sc= new Scanner(System.in);
        int n=sc.nextInt();
        double k=sc.nextDouble();

        if(k%2!=0)
            System.out.println(1);
        else{
            for(int i=1;i<=n;i++){
                if((int)(k/Math.pow(2, i))%2!=0){
                    System.out.println(i+1);
                    break;
                }
            }
        }
    }
}

import java.util.*;

public class Solution {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        long k = scanner.nextLong();
        int number = 0;
        if (k % 2 != 0) {
            number = 1;
        } else {
            for (int i = 2; i <= n; i++) {
                double lastPosition = Math.pow(2, i - 1);
                if (k == lastPosition) {
                    number = i;
                    break;
                }
                for (int j = 2; j <= n; j++) {
                    double latestPos = lastPosition + Math.pow(2, i);
                    if (k == latestPos) {
                        number = i;
                        break;
                    } else {
                        lastPosition = latestPos;
                    }
                }
                if (number != 0) break;
            }
        }
        System.out.print(number);
    }
}

import java.util.*;
import java.lang.*;
import java.io.*;
import java.awt.Point;

// SHIVAM GUPTA :
//NSIT
//decoder_1671
//BEING PERFECTIONIST IS NOT AN OPTION.
// STOP NOT TILL IT IS DONE OR U DIE .
//EITHER MAKE IT OR BREAK IT.
//NEVER UNDERESTIMATE URSELF.
// U KNOW THAT IF THIS DAY WILL BE URS THEN NO ONE CAN DEFEAT U
// REST ..HAVE FAITH ON DESTINY

// ASCII = 48 + i ;

// 2^28 = 268,435,456  > 10^8

// log 10 base 2 = 3.3219

// odd:: (x^2+1)/2 , (x^2-1)/2 ; x>=3

// even:: (x^2/4)+1 ,(x^2/4)-1  x >=4

/* Name of the class has to be "Main" only if the class is public. */

public class Main
{

    // static int[] arr = new int[100002] ;
    // static int[] dp = new int[100002] ;

    static PrintWriter out;

	static class FastReader{
		BufferedReader br;
		StringTokenizer st;
		public FastReader(){
			br=new BufferedReader(new InputStreamReader(System.in));
			out=new PrintWriter(System.out);
		}
		String next(){
			while(st==null || !st.hasMoreElements()){
				try{
					st= new StringTokenizer(br.readLine());
				}
				catch (IOException e){
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		long nextLong(){
			return Long.parseLong(next());
		}
		double nextDouble(){
			return Double.parseDouble(next());
		}
		String nextLine(){
			String str = "";
			try{
				str=br.readLine();
			}
			catch(IOException e){
				e.printStackTrace();
			}
			return str;
		}
	}

/////////////////////////////////////////////////////////////////////////////////////

public static int  min(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[0];

}

 /////////////////////////////////////////////////////////////////////////////

public static int  max(int a ,int b , int c, int d)
{

      int[] arr = new int[4] ;
      arr[0] = a;
      arr[1] = b ;
      arr[2] = c;
      arr[3] = d;
      Arrays.sort(arr) ;

      return arr[3];

}

///////////////////////////////////////////////////////////////////////////////////
static int sieve =  1000000 ;

static boolean[] prime =  new boolean[sieve + 1] ;

public static void sieveOfEratosthenes()
    {
        // FALSE == prime

        // TRUE ==  COMPOSITE

        // FALSE== 1

        // time complexity = 0(NlogLogN)== o(N)

        // gives prime nos bw 1 to N

        for(int i = 2; i<= sieve ; i++)
        {
            prime[i] = true  ;
            i++ ;
        }

        for(int p = 3; p*p <= sieve; p++)
        {

            if(prime[p] == false)
            {

                for(int i = p*p; i <= sieve; i += p)
                    prime[i] = true;
            }

            p++ ;
        }

    }

///////////////////////////////////////////////////////////////////////////////////

public static String reverse(String input)
{
    String op = "" ;

    for(int i = 0; i < input.length() ; i++ )
    {
        op = input.charAt(i)+  op ;
    }

return op ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static void sortD(int[] arr , int s  , int e)
{
      sort(arr ,s , e) ;

      int i =s ; int j = e  ;

      while( i < j)
      {
            int temp = arr[i] ;
            arr[i] =arr[j] ;
            arr[j] = temp ;
            i++ ; j-- ;
      }

      return ;
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(long a  ,long b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

///////////////////////////////////////////////////////////////////////////////////////

public static boolean sameParity(int a  ,int b )
{

      if(a%2 == b %2)
      {
            return true  ;
      }
      else{
            return false  ;
      }
}

////////////////////////////////////////////////////////////////////////////////////

public static boolean isPossibleTriangle(int a  ,int b , int c)
{
      if( a + b > c && c+b > a && a +c > b)
      {
            return true  ;
      }

      return false  ;

}

/////////////////////////////////////////////////////////////////////////////////

public static long countSubarraysSumToK(long[] arr ,long sum )
    {
      HashMap<Long,Long> map = new HashMap<>() ;

      int n = arr.length ;

      long prefixsum = 0 ;

      long count = 0L ;
      for(int i  = 0; i < n ; i++)
      {
          prefixsum  = prefixsum +  arr[i] ;

          if(sum == prefixsum)count = count+1 ;

          if(map.containsKey(prefixsum -sum))
          {
              count = count + map.get(prefixsum -sum) ;
          }

          if(map.containsKey(prefixsum ))
          {
              map.put(prefixsum , map.get(prefixsum) +1 );
          }

          else{
              map.put(prefixsum , 1L );
          }

      }

      return count  ;

    }

///////////////////////////////////////////////////////////////////////////////////////

public static int gcd(int a, int b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

//////////////////////////////////////////////////////////////////////////////////
public static long gcd(long a, long b )
{

if(b==0)return a ;

else return gcd(b,a%b) ;

}

////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c , int d )
{

int temp = lcm(a,b , c) ;

 int ans = lcm(temp ,d ) ;

return ans  ;

}

//////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a, int b ,int c )
{

int temp = lcm(a,b) ;

int ans =  lcm(temp ,c) ;

return ans  ;

}

////////////////////////////////////////////////////////////////////////////////////////

public static int lcm(int a , int b )
{

int gc = gcd(a,b);

return (a*b)/gc ;

}

///////////////////////////////////////////////////////////////////////////////////

    // CALCULATE TOTIENT Fn FOR ALL VALUES FROM 1 TO n
    // TOTIENT(N) = count of nos less than n and grater than 1 whose gcd with n is 1
    // or n and the no  will be coprime in nature
    //time : O(n*(log(logn)))

    public static void eulerTotientFunction(int[] arr ,int n )
    {

      for(int i = 1; i <= n  ;i++)arr[i] =i  ;

      for(int i= 2 ; i<= n ;i++)
      {
          if(arr[i] == i)
          {
              arr[i] =i-1 ;

              for(int j =2*i ; j<= n  ; j+= i )
              {
                  arr[j] = (arr[j]*(i-1))/i ;
              }

          }
      }

      return  ;

    }

/////////////////////////////////////////////////////////////////////////////////////////////

static boolean isPrime(int n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(int i = 2; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}

static boolean isPrime(long n)
{
      if(n==1)
      {
            return false  ;
      }

      boolean ans =  true  ;

      for(long i = 2L; i*i <= n ;i++)
      {
            if(n% i ==0)
            {
                  ans = false  ;break ;
            }
      }

      return ans  ;

}
//////////////////////////////////////////////////////////////////////////////////////////
public static long nCr(int n,int k)
{
    long ans=1;
    k=k>n-k?n-k:k;
    int j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
///////////////////////////////////////////////////////////////////////////////////////////

public static ArrayList<Integer> allFactors(int n)
{
      ArrayList<Integer> list = new ArrayList<>() ;

    for(int i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

///////////////////////////////////////////////////////////////////////////

public static ArrayList<Long> allFactors(long n)
{
      ArrayList<Long> list = new ArrayList<>() ;

    for(long i = 1; i*i <= n ;i++)
    {
          if( n % i == 0)
          {
              if(i*i == n)
              {
                    list.add(i) ;
              }
              else{
                    list.add(i) ;
                    list.add(n/i) ;

              }
          }
    }

     return list ;

}

/////////////////////////////////////////////////////////////////////////////

public static boolean isPowerOfTwo(int n)
{
    if(n==0)
    return false;

if(((n ) & (n-1)) == 0 ) return true ;
else return false  ;

}

////////////////////////////////////////////////////////////////////////////////////

    public static int countDigit(long n)
    {
        return (int)Math.floor(Math.log10(n) + 1);
    }

 /////////////////////////////////////////////////////////////////////////////////////////

 public static int sumOfDigits(long n)
 {

  if( n< 0)return -1 ;

  int sum = 0;

  while( n > 0)
  {
      sum = sum + (int)( n %10) ;

      n /= 10 ;
  }

  return sum ;

 }
 /////////////////////////////////////////////////////////////////////////////////////////

  static final int MAXN = 100001;

    static int spf[] = new int[MAXN];

    static void sieve()
    {
        spf[1] = 1;
        for (int i=2; i<MAXN; i++)

            spf[i] = i;

        for (int i=4; i<MAXN; i+=2)
            spf[i] = 2;

        for (int i=3; i*i<MAXN; i++)
        {

            if (spf[i] == i)
            {

                for (int j=i*i; j<MAXN; j+=i)

                    if (spf[j]==j)
                        spf[j] = i;
            }
        }
    }

// The above code works well for n upto the order of 10^7.
// Beyond this we will face memory issues.

// Time Complexity: The precomputation for smallest prime factor is done in O(n log log n)
// using sieve.
// Where as in the calculation step we are dividing the number every time by
// the smallest prime number till it becomes 1.
// So, let’s consider a worst case in which every time the SPF is 2 .
// Therefore will have log n division steps.

// Hence, We can say that our Time Complexity will be O(log n) in worst case.

    static Vector<Integer> getFactorization(int x)
    {
        Vector<Integer> ret = new Vector<>();
        while (x != 1)
        {
            ret.add(spf[x]);
            x = x / spf[x];
        }
        return ret;
    }

  //////////////////////////////////////////////////////////////////////////////////////////////////
  //////////////////////////////////////////////////////////////////////////////////////////////////

public static void merge(int arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        int L[] = new int[n1];
        int R[] = new int[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

    // Main function that sorts arr[l..r] using
    // merge()
  public static void sort(int arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
public static void sort(long arr[], int l, int r)
    {
        if (l < r)
        {
            // Find the middle point
            int m = (l+r)/2;

            // Sort first and second halves
            sort(arr, l, m);
            sort(arr , m+1, r);

            // Merge the sorted halves
            merge(arr, l, m, r);
        }
    }

public static void merge(long arr[], int l, int m, int r)
    {
        // Find sizes of two subarrays to be merged
        int n1 = m - l + 1;
        int n2 = r - m;

        /* Create temp arrays */
        long L[] = new long[n1];
        long R[] = new long[n2];

        /*Copy data to temp arrays*/
        for (int i=0; i<n1; ++i)
            L[i] = arr[l + i];
        for (int j=0; j<n2; ++j)
            R[j] = arr[m + 1+ j];

        /* Merge the temp arrays */

        // Initial indexes of first and second subarrays
        int i = 0, j = 0;

        // Initial index of merged subarry array
        int k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        /* Copy remaining elements of L[] if any */
        while (i < n1)
        {
            arr[k] = L[i];
            i++;
            k++;
        }

        /* Copy remaining elements of R[] if any */
        while (j < n2)
        {
            arr[k] = R[j];
            j++;
            k++;
        }
    }

 /////////////////////////////////////////////////////////////////////////////////////////

	public static long knapsack(int[] weight,long value[],int maxWeight){

        int n=  value.length ;

	//dp[i] stores the profit with KnapSack capacity "i"
  long []dp = new long[maxWeight+1];

    //initially profit with 0 to W KnapSack capacity is 0
    Arrays.fill(dp, 0);

    // iterate through all items
    for(int i=0; i < n; i++)

        //traverse dp array from right to left
        for(int j = maxWeight; j >= weight[i]; j--)
            dp[j] = Math.max(dp[j] , value[i] + dp[j - weight[i]]);

    /*above line finds out maximum of dp[j](excluding ith element value)
    and val[i] + dp[j-wt[i]] (including ith element value and the
    profit with "KnapSack capacity - ith element weight") */
    return dp[maxWeight];
	}

///////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////

// to return max sum of any subarray in given array
public static long kadanesAlgorithm(long[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}
/////////////////////////////////////////////////////////////////////////////////////////////
public static long kadanesAlgorithm(int[] arr)
{
      long[] dp = new long[arr.length] ;

      dp[0] = arr[0] ;
      long max =  dp[0] ;

      for(int i = 1; i <  arr.length ; i++)
      {
            if(dp[i-1] > 0)
            {
                  dp[i] = dp[i-1] + arr[i] ;
            }
            else{
                  dp[i] = arr[i] ;
            }

            if(dp[i] >  max)max = dp[i] ;

      }

      return max  ;

}

///////////////////////////////////////////////////////////////////////////////////////

// Arrays.sort(arr, new Comparator<Pair>() {
// 			@Override
// 			public int compare(Pair first, Pa second) {
// 				if (first.getAge() != second.getAge()) {
// 					return first.getAge() - second.getAge();
// 				}
// 				return first.getName().compareTo(second.getName());
// 			}
// 		});

/////////////////////////////////////////////////////////////////////////////////////////

public static long binarySerachGreater(int[] arr , int start , int end , int val)
{

      // fing total no of elements strictly grater than val in sorted array arr

      if(start >  end)return  0 ; //Base case

      int mid = (start + end)/2  ;

      if(arr[mid] <=val)
      {
          return binarySerachGreater(arr,mid+1, end ,val) ;

      }
      else{

         return binarySerachGreater(arr,start , mid -1,val) + end-mid+1 ;

      }

}

//////////////////////////////////////////////////////////////////////////////////

//TO GENERATE ALL(DUPLICATE ALSO EXIST) PERMUTATIONS OF A STRING

//Function for swapping the characters at position I with character at position j
    public static String swapString(String a, int i, int j) {
        char[] b =a.toCharArray();
        char ch;
        ch = b[i];
        b[i] = b[j];
        b[j] = ch;
        return String.valueOf(b);
    }

//Function for generating different permutations of the string
    public static void generatePermutation(String str, int start, int end)
    {
        //Prints the permutations
        if (start == end-1)
            System.out.println(str);
        else
        {
            for (int i = start; i < end; i++)
            {
                //Swapping the string by fixing a character
                str = swapString(str,start,i);
                //Recursively calling function generatePermutation() for rest of the characters
                generatePermutation(str,start+1,end);
                //Backtracking and swapping the characters again.
                str = swapString(str,start,i);
            }
        }
    }

// JUST CALL generatePermutation( str,  start,  end) start :inclusive ,end : exclusive

////////////////////////////////////////////////////////////////////////////////////

public static long arraySum(int[] arr , int start , int end)
{
    long ans = 0 ;

    for(int i = start ; i <= end  ; i++)ans += arr[i] ;

    return ans  ;
}

/////////////////////////////////////////////////////////////////////////////////

public static int mod(int x)
{
      if(x <0)return -1*x ;
      else return x ;
}
public static long mod(long x)
{
      if(x <0)return -1*x ;
      else return x ;
}

////////////////////////////////////////////////////////////////////////////////

public static void swapArray(int[] arr , int start , int end)
{
    while(start < end)
    {
        int temp = arr[start] ;
        arr[start] = arr[end];
        arr[end] = temp;
        start++ ;end-- ;
    }
}

//////////////////////////////////////////////////////////////////////////////////

public static long factMod(long n, long mod) {
    if (n <= 1) return 1;
    long ans = 1;
    for (int i = 1; i <= n; i++) {
      ans = (ans * i) % mod;
    }
    return ans;
  }

/////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////
public static long power(int x  ,int n)
    {
        //time comp : o(logn)

        if(n==0)return 1 ;
        if(n==1)return x;

        long ans =1  ;

      while(n>0)
      {
          if(n % 2 ==1)
          {
              ans = ans *x ;
          }

          n /= 2 ;

          x =  x*x ;

      }

      return ans ;
    }

////////////////////////////////////////////////////////////////////////////////////////////////////
public static long powerMod(long x, long n, long mod) {
    //time comp : o(logn)

    if(n==0)return 1L ;
        if(n==1)return x;

    long ans = 1;
    while (n > 0) {
      if (n % 2 == 1) ans = (ans * x) % mod;
      x = (x * x) % mod;
      n /= 2;
    }
    return ans;
  }

//////////////////////////////////////////////////////////////////////////////////

public static int[][] rotate(int[][] input){

int n =input.length;
int m = input[0].length ;
int[][] output = new int [m][n];

for (int i=0; i<n; i++)
	for (int j=0;j<m; j++)
		output [j][n-1-i] = input[i][j];
return output;
}

//////////////////////////////////////////////////////////////////////////////////

/*
lowerBound - finds largest element equal or less than value paased
upperBound - finds smallest element equal or more than value passed

if not present return -1;

*/

public static long lowerBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static int lowerBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]<=k)
			{
				ans=arr[mid];
				start=mid+1;
			}
			else
			{
				end=mid-1;
			}

		}

		return ans;

	}

	public static long upperBound(long[] arr,long k)
	{
		long ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

	public static int upperBound(int[] arr,int k)
	{
		int ans=-1;

		int start=0;
		int end=arr.length-1;

		while(start<=end)
		{
			int mid=(start+end)/2;

			if(arr[mid]>=k)
			{
				ans=arr[mid];
				end=mid-1;
			}
			else
			{
				start=mid+1;
			}

		}

		return ans;
	}

/////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////

public static void solve()
{
FastReader scn = new FastReader() ;

//ArrayList<Integer> list = new ArrayList<>() ;
ArrayList<Long> list = new ArrayList<>() ;
ArrayList<Integer> lista = new ArrayList<>() ;
ArrayList<Integer> listb = new ArrayList<>() ;

//HashMap<Integer,Integer> map = new HashMap<>() ;
HashMap<Long,Integer> map = new HashMap<>() ;
HashMap<Integer,Integer> map1  = new HashMap<>() ;
HashMap<Integer,Integer> map2  = new HashMap<>() ;
//HashMap<Point,> point = new HashMap<>() ;

//int[] store = {2 ,3, 5 , 7  ,11 , 13 , 17 , 19 , 23 , 29 , 31 , 37 } ;

// product of first 11 prime nos is gre ater than 10 ^ 12;

//HashMap<String,Integer> maps = new HashMap<>() ;
//HashMap<Integer,Boolean> mapb = new HashMap<>() ;

//if(map.containsKey(arr[i]))map.put(arr[i] , map.get(arr[i]) +1 ) ;
//else map.put(arr[i],1) ;

// if(map.containsKey(temp))map.put(temp , map.get(temp) +1 ) ;
// else map.put(temp,1) ;

Set<Integer> set = new HashSet<>() ;
//Set<Integer> sety = new HashSet<>() ;

int t = 1;
// t = scn.nextInt() ;

while(t-- > 0)
{

 //String str  = scn.next() ;
 //long n = scn.nextLong() ;
  //long k = scn.nextLong() ;

 //int n = scn.nextInt() ;
 //int m = scn.nextInt() ;
//int k = scn.nextInt() ;
// int x  = scn.nextInt() ;
// int y = scn.nextInt() ;
 //int a = scn.nextInt() ;
//long a = scn.nextLong() ;
 //int b = scn.nextInt() ;
//long b = scn.nextLong() ;
 //int c = scn.nextInt() ;
// int d = scn.nextInt() ;

long n = scn.nextLong() ;

long k = scn.nextLong() ;

long ans = n ;

long start =1L ;
long end = (long)Math.pow(((n)*1.0),2.0) -1L;

while(start <= end)
{
    long mid  =(start +end)/2L ;

    if(mid == k)
    {
      break ;
    }

    else if( mid > k)
    {

        end = mid-1 ;
         ans-- ;

    }

    else{

        start = mid+1;
        ans-- ;

    }

}

out.println(ans) ;

//for(int i = 0; i < n; i++)out.print(arr[i]+ " ") ;

//out.println() ;

list.clear() ;
map.clear() ;
map1.clear() ;
map2.clear() ;
set.clear() ;
} // test case  end loop

out.flush() ;
}

public static void main (String[] args) throws java.lang.Exception
{

solve() ;

}

}

 class Pair
{
  int first ;

  int second  ;

@Override
	public String toString() {

	String ans = "" ;
	ans  += this.first ;
	ans += " ";
	ans += this.second ;

	return ans  ;
	}

}

import java.io.*;
import java.util.*;
import java.util.logging.Logger;

import static java.lang.System.exit;
import static java.lang.System.out;
import static java.lang.System.setOut;

public class Main {
    static BufferedReader br;
    //static  long mod  = 1000
    static HashSet<Integer> p  = new HashSet<>();
    public static void main(String[] args) throws Exception {
        br = new BufferedReader(new InputStreamReader(System.in));

        // System.out.println((rem*i));
        int testcCase=1;
       // testcCase =cinI();

        while (testcCase-->0) {

     long[] arr = readArray(2,0);
     long n  =arr[0];long k  =arr[1];
           ///25 :-> find nearest 2 power
            long ans =-1;
           while (true){

               long x = k;
                 long res = x &(x-1);
             //  System.out.println(x +" "+res);
               //System.out.println(1<<0);
               if(x>0 && (res==0)){
                      for(int i=0;i<51;i++){
                          long p  =1<<i;

                          long rr = p&x;
                          if(rr==x){
                           //   System.out.println(i +" "+x +" "+rr+ " "+p);
                              ans=i+1;
                              break;
                          }
                      }
                    break;
               }

               long p=1;
               while (p<x){

                   p = p<<1;

               }
               p=p/2;

               k = k%p;

           }
            out.println(ans);
        }

    }
    public static long min(long a,long b) {
        return Math.min(a,b);
    }
    public static int min(int a,int b) {
        return Math.min(a,b);
    }

    public  static  int[] readArray(int n,int x ,int z)throws Exception{
        int[] arr= new int[n];
        String[] ar= cinA();
        for(int i =x ;i<n+x;i++){
            arr[i]=getI(ar[i-x]);
        }
        return arr;
    }
    public  static  long[] readArray(int n,int x )throws Exception{
        long[] arr= new long[n];
        String[] ar= cinA();
        for(int i =x ;i<n+x;i++){
            arr[i]=getL(ar[i-x]);
        }
        return arr;
    }

    public static void arrinit(String[] a,long[] b)throws Exception{
        for(int i=0;i<a.length;i++){
            b[i]=Long.parseLong(a[i]);
        }
    }
    public  static HashSet<Integer>[]  Graph(int n,int edge,int directed)throws Exception{
        HashSet<Integer>[] tree=  new HashSet[n];

        for(int j=0;j<edge;j++){

            String[] uv = cinA();
            int u = getI(uv[0]);
            int v = getI(uv[1]);
            if(directed==0){

                tree[v].add(u);
            }
            tree[u].add(v);
        }
        return tree;
    }
    public static void arrinit(String[] a,int[] b)throws Exception{
        for(int i=0;i<a.length;i++){
            b[i]=Integer.parseInt(a[i]);
        }
    }

    static double findRoots(int a, int b, int c) {
        // If a is 0, then equation is not
        //quadratic, but linear

        int d = b * b - 4 * a * c;
        double sqrt_val = Math.sqrt(Math.abs(d));

        // System.out.println("Roots are real and different \n");

        return Math.max((double) (-b + sqrt_val) / (2 * a),
                (double) (-b - sqrt_val) / (2 * a));

    }

    public static String cin() throws Exception {
        return br.readLine();
    }

    public static String[] cinA() throws Exception {
        return br.readLine().split(" ");
    }
    public static String[] cinA(int x) throws Exception{
        return br.readLine().split("");
    }

    public static String ToString(Long x) {
        return Long.toBinaryString(x);
    }

    public static void cout(String s) {
        System.out.println(s);
    }

    public static Integer cinI() throws Exception {
        return Integer.parseInt(br.readLine());
    }

    public static int getI(String s) throws Exception {
        return Integer.parseInt(s);
    }

    public static long getL(String s) throws Exception {
        return Long.parseLong(s);
    }

    public static long max(long a, long b) {
        return Math.max(a, b);
    }
    public static int max(int a, int b) {
        return Math.max(a, b);
    }

    public static void coutI(int x) {
        System.out.println(String.valueOf(x));
    }

    public static void coutI(long x) {
        System.out.println(String.valueOf(x));
    }

    public static Long cinL() throws Exception {
        return Long.parseLong(br.readLine());
    }

    public static void arrInit(String[] arr, int[] arr1) throws Exception {
        for (int i = 0; i < arr.length; i++) {
            arr1[i] = getI(arr[i]);
        }

    }
}

import java.util.InputMismatchException;

import java.io.IOException;
import java.io.PrintWriter;

public class B_384 {

	/**************Scanner********************/
	static class FastReader {
		private byte[] buf = new byte[1024];
		private int curChar;
		private int snumChars;

		public int read() {
			if (snumChars == -1)
				throw new InputMismatchException();
			if (curChar >= snumChars) {
				curChar = 0;
				try {
					snumChars = System.in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (snumChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isEndOfLine(c));
			return res.toString();
		}

		public String nextString() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(c);
				c = read();
			} while (!isSpaceChar(c));
			return res.toString();
		}

		public long nextLong() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			long res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int nextInt() {
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-') {
				sgn = -1;
				c = read();
			}
			int res = 0;
			do {
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			} while (!isSpaceChar(c));
			return res * sgn;
		}

		public int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextInt();
			}
			return arr;
		}

		public long[] nextLongArray(int n) {
			long[] arr = new long[n];
			for (int i = 0; i < n; i++) {
				arr[i] = nextLong();
			}
			return arr;
		}

		private boolean isSpaceChar(int c) {
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
	}

	/************main*************/
	public static void main(String args[]) {

		FastReader scan = new FastReader();
		PrintWriter out = new PrintWriter(System.out);
		/*******************code***********************/
		int n=scan.nextInt();
		int k=scan.nextInt();
		String s=new String();
		s=s+"121";
		int count=3;
		for(int i=2;i<n;i++)
		{
			s=s+count+s;
			count++;
		}
		out.println(s.charAt(k-1));
		out.close();

	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author P Marecki
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        int go(int n, long k) {
            if (n == 1) return 1;
            long mid = (1 << (n - 1)) - 1;
            if (k == mid) return n;
            if (k > mid) k -= mid;
            return go(n - 1, k);
        }

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long k = in.nextInt() - 1;
            out.println(go(n, k));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B {
	public static void main(String[] args) throws IOException{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String[] ns = bf.readLine().split(" ");
		int n = Integer.parseInt(ns[0]), k = Integer.parseInt(ns[1])-1;
		long length = 1;
		for(int i = 1;i<=n;i++){
			if(k<length){
				System.out.println(i);
				return;
			}
			length = 2*length+1;
		}
	}
}

import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by yuu on 15/4/17.
 */
public class Problem743B {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long k = sc.nextLong();

        int currentN = (int)Math.ceil(Math.log(k+1)/Math.log(2));
        while (true) {
            if (k == Math.pow(2, currentN-1)) {
                System.out.println(currentN);
                return;
            }
            else if (k > Math.pow(2, currentN-1)){
                k -= Math.pow(2, currentN-1);
            }
            currentN--;
        }
    }
}

import java.io.*;
import java.lang.reflect.Array;
import java.math.BigInteger;
import java.util.*;

/**
 * @author maxkrivich
 */
public final class Main {
    private void solve() {
        int n = in.nextInt();
        long k = in.nextLong();
        long x = 1 << 62;
        int z=0;
        for (long i=1;i<=x;i*=2){
            if (k%i*2==i){
                out.print(z);
            }
            z++;
        }
    }

    //    -------------I/O-------------    \\
    void run() {
        try {
            in = new FScanner(new File("input.txt"));
            out = new PrintWriter(new BufferedWriter(new FileWriter(new File("output.txt"))));
            solve();
            out.close();
            in.close();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

    void runIO() {
        in = new FScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));
        solve();
        out.close();
        in.close();
    }

    public static void main(String[] args) {
        new Main().runIO();
    }

    private FScanner in;
    private PrintWriter out;

    class FScanner {

        private BufferedReader br;
        private StringTokenizer st;

        public FScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            }
        }

        void useString(String s) {
            if (s != null) {
                st = new StringTokenizer(s);
            }
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String s = "";
            try {
                s = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return s;
        }

        void close() {
            try {
                br.close();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }

    }
}

import java.util.Scanner;

public class B743 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		long k = scanner.nextLong();

		long lastPosition = (long)Math.pow(2, n);

		long start = 0;
		long mid = start + (lastPosition - start)/2;

		while(k!=n && start < lastPosition) {
			if(k< mid) 	lastPosition = mid-1;
			else if(k>mid)	start = mid+1;
			else break;
			mid = start + (lastPosition - start)/2;
			n--;
		}
		System.out.println(n);
	}

}

import java.io.IOException;
import java.io.InputStream;
import java.util.InputMismatchException;

public class B384{

	void solve()
	{
		int n = ni();
		long k = ni();
		int cn = 1;
		while(k!=0)
		{
			if((k&1)==1)
			{
				System.out.println(cn);
				return;
			}
			else
			{
				cn++;
				k>>=1;
			}
		}
	}

	public static void main(String[] args){new B384().solve();}

	private byte[] bufferArray = new byte[1024];
	private int bufLength = 0;
	private int bufCurrent = 0;
	InputStream inputStream = System.in;

	int nextByte()
	{
		if(bufLength==-1)
			throw new InputMismatchException();
		if(bufCurrent>=bufLength)
		{
			bufCurrent = 0;
			try
			{bufLength = inputStream.read(bufferArray);}
			catch(IOException e)
			{ throw new InputMismatchException();}
			if(bufLength<=0)
				return -1;
		}
		return bufferArray[bufCurrent++];
	}

	boolean isSpaceChar(int x)
	{return (x<33 || x>126);}

	boolean isDigit(int x)
	{return (x>='0' && x<='9');}

	int nextNonSpace()
	{
		int x;
		while((x=nextByte())!=-1 && isSpaceChar(x));
		return x;
	}

	int ni()
	{
		int ans = 0;
		int sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	long nl()
	{
		long ans = 0;
		long sign = 1;
		int x = nextNonSpace();
		if(x=='-')
		{
			sign = -1;
			x = nextByte();
		}
		while(!isSpaceChar(x))
		{
			if(isDigit(x))
			{
				ans = ans*10 + x -'0';
				x = nextByte();
			}
			else
				throw new InputMismatchException();
		}
		return sign*ans;
	}

	String ns()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(!isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	String nL()
	{
		StringBuilder sb = new StringBuilder();
		int x = nextNonSpace();
		while(x==32 || !isSpaceChar(x))
		{
			sb.append((char)x);
			x = nextByte();
		}
		return sb.toString();
	}

	char nc()
	{ return (char)nextNonSpace();}

	double nd()
	{ return (double)Double.parseDouble(ns()); }

	char[] ca()
	{ return ns().toCharArray();}

	char[] ca(int n)
	{
		char[] ans = new char[n];
		int p =0;
		int x = nextNonSpace();
		while(p<n)
		{
			ans[p++] = (char)x;
			x = nextByte();
		}
		return ans;
	}

	int[] ia(int n)
	{
		int[] ans = new int[n];
		for(int i=0;i<n;i++)
			ans[i]=ni();
		return ans;
	}

	long[] la(int n)
	{
		long[] ans = new long[n];
		for(int i=0;i<n;i++)
			ans[i] = nl();
		return ans;
	}

}

import java.util.*;
import java.io.*;

public class template {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		Long k = sc.nextLong();

		System.out.println(k);

		if(k%2!=0) System.out.println("1");

		int arbcounter = 1;
		int iters = 0;
		while(k>arbcounter){
			arbcounter = arbcounter*2 + 1;
			iters += 1;
		}

		for(int i=iters; i>0; i--){
			if(k% Math.pow(2, i) ==0){
				System.out.println(i+1);
				break;
			}
		}

	}
}

import java.util.Scanner;
public class Prog743B {
    static Scanner sc = new Scanner(System.in);
    private static void solve(){
        byte n = sc.nextByte();
        long k = sc.nextLong();
        byte i = 0;
        while ((k & 1<<i) == 0){
            i++;
        }
        System.out.println(i+1);
    }
    public static void main(String[] args) {
        solve();
        sc.close();
    }
}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;

public class TestClass {
	private static InputStream stream;
	private static byte[] buf = new byte[1024];
	private static int curChar;
	private static int numChars;
	private static SpaceCharFilter filter;
	private static PrintWriter pw;

	public static class Queue{
		private class node{
			int val;
			node next;
			node(int a){
				val = a;
				next = null;
			}
		}
		node head,tail;
		Queue(){
			head = null;
			tail = null;
		}
		public void EnQueue(int a){
			if(head==null){
				node p = new node(a);
				head = p;
				tail = p;
			}
			else{
				node p = new node(a);
				tail.next = p;
				tail = p;
			}
		}
		public int DeQueue(){
			int a = head.val;
			head = head.next;
			return a;
		}
		public boolean isEmpty(){
			return head==null;
		}
	}
	public static long pow(long x,long y,long m){
		if(y==0)
    		return 1;
    	long k = pow(x,y/2,m);
    	if(y%2==0)
    		return (k*k)%m;
    	else
    		return (((k*k)%m)*x)%m;
    }
	static long Inversex = 0,Inversey = 0;
	public static void InverseModulo(long a,long m){
		if(m==0){
			Inversex = 1;
			Inversey = 0;
		}
		else{
    		InverseModulo(m,a%m);
    		long temp = Inversex;
    		Inversex = Inversey;
    		Inversey = temp+ - (a/m)*Inversey;
    	}
    }
    static long mod1 = 1000000007;
    static long mod2 = 1000000009;
	public static long gcd(long a,long b){
		if(a%b==0)
			return b;
		return gcd(b,a%b);
	}
	public static boolean isPrime(long a){
		if(a==1)
			return false;
		else if(a==2||a==3)
			return true;
		for(long i=2;i<=Math.sqrt(a);i++)
			if(a%i==0)
				return false;
		return true;
	}
	public static double distance(int a,int b,int x,int y){
		return Math.sqrt(((long)(a-x)*(long)(a-x))+((long)(b-y)*(long)(b-y)));
	}
	public static class Pair implements Comparable<Pair> {
		long u;
		long v;
		BigInteger bi;
		public Pair(long u, long v) {
			this.u = u;
			this.v = v;
		}
		public int hashCode() {
			int hu = (int) (u ^ (u >>> 32));
			int hv = (int) (v ^ (v >>> 32));
			return 31 * hu + hv;
		}
		public boolean equals(Object o) {
			Pair other = (Pair) o;
			return u == other.u && v == other.v;
		}
		public int compareTo(Pair other) {
			return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
		}
		public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}
	}
	public static int seive(int a[],boolean b[],ArrayList c){
		int count = 0;
		for(int i=2;i*i<a.length;i++){
			if(!b[i]){
				for(int j=i*i;j<a.length;j=j+i)
					b[j] = true;
				c.add(i);
				a[count++] = i;
			}
		}
		return count;
	}
	public static void MatrixMultiplication(int a[][],int b[][],int c[][]){
		for(int i=0;i<a.length;i++){
			for(int j=0;j<b[0].length;j++){
				c[i][j] = 0;
				for(int k=0;k<b.length;k++)
					c[i][j]=(int)((c[i][j]+((a[i][k]*(long)b[k][j])%mod1))%mod1);
			}
		}
	}
	public static void Equal(int arr[][],int temp[][]){
		for(int i=0;i<arr.length;i++){
			for(int j=0;j<arr.length;j++)
				temp[i][j] = arr[i][j];
		}
	}
	private static void soln(){
		int n = nI();
		int k = nI();
		long p = (int)Math.pow(2, n);
		p/=2;
		while(k%p!=0){
			p/=2;
			n--;
		}
		pw.println(n);
	}
	public static void main(String[] args) {
		InputReader(System.in);
		pw = new PrintWriter(System.out);
		soln();
		pw.close();
	}
	// To Get Input
	// Some Buffer Methods
	public static void InputReader(InputStream stream1) {
		stream = stream1;
	}
	private static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
	private static boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}
	private static int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}
	private static int nI() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	private static long nL() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	private static String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}
	private static String nLi() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}
	private static int[] nIA(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++)
			arr[i] = nI();
		return arr;
	}
	private static long[] nLA(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++)
			arr[i] = nL();
		return arr;
	}
	private static void pArray(int[] arr) {
		for (int i = 0; i < arr.length; i++)
			pw.print(arr[i] + " ");
		pw.println();
		return;
	}
	private static void pArray(long[] arr) {
		for (int i = 0; i < arr.length; i++)
			pw.print(arr[i] + " ");
		pw.println();
		return;
	}
	private static boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}
	private interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

import java.util.*;

public class B {
public static void main (String [] args)
{
  Scanner scan = new Scanner(System.in);
  int n = scan.nextInt();
  int a = scan.nextInt();
  System.out.println(fun(n,a));
}
public static String fun(int a,int b){
  String res = "";
  for(int i=1;i<=a;i++){
    res = res + i + res;
  }
  return res.charAt(b-1)+"";
}
}

import java.util.*;

/**
 *
 * @author steph
 */
public class Main {

public static String sequence(int num,int pos){
    String sequence="1";
    for (int i = 1; i < num; i++) {
        sequence=sequence+(i+1)+sequence;
        if (sequence.length()>pos) {
            break;
        }
    }
    return sequence;
}

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int sequen=sc.nextInt();
        int pos=sc.nextInt();
        System.out.println(sequence(sequen,pos).charAt(pos-1));
    }

}

import java.util.*;

public class B {
public static void main (String [] args)
{
  Scanner scan = new Scanner(System.in);
  int n = scan.nextInt();
  int a = scan.nextInt();
  scan.nextLine();
  System.out.println(fun(n,a));
}
public static int fun(int a,int b){
  String res = "1";
  for(int i=2;i<=a;i++){
    res = res + i + res;
  }
  return res.charAt(b-1)-'0';
}
}

import java.io.*;
import java.util.*;

public class main {

    public static void main(String[] args) {
        InputReader sc=new InputReader(System.in);
        int n=sc.nextInt();
        int k=sc.nextInt();
        int i;
        for(i=n-1;i>=0;i--){
        	if(k==Math.pow(2, i)){
        		System.out.println(i+1);
        		break;
        	}
        	if(k>Math.pow(2, i)){
        		k=2*i-k;
        	}

        }
      //  if(i==0)
        //	System.out.println("1");
    }

    static class Pair implements Comparable<Pair> {
		int idx;
		double val;

		Pair(int i, double v) {
			idx = i;
			val = v;
		}

		public int compareTo(Pair o) {
			if (val != o.val)
				return Double.compare(val, o.val);
			return Integer.compare(idx, o.idx);
		}

		public String toString() {
			return idx + " " + val;
		}
	}

    static class InputReader {

    private final InputStream stream;
    private final byte[] buf = new byte[8192];
    private int curChar, snumChars;
    private SpaceCharFilter filter;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public int snext() {
        if (snumChars == -1)
            throw new InputMismatchException();
        if (curChar >= snumChars) {
            curChar = 0;
            try {
                snumChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (snumChars <= 0)
                return -1;
        }
        return buf[curChar++];
    }

    public int nextInt() {
        int c = snext();
        while (isSpaceChar(c)) {
            c = snext();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = snext();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = snext();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = snext();
        while (isSpaceChar(c)) {
            c = snext();
        }
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = snext();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9')
                throw new InputMismatchException();
            res *= 10;
            res += c - '0';
            c = snext();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public int[] nextIntArray(int n) {
        int a[] = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    public String readString() {
        int c = snext();
        while (isSpaceChar(c)) {
            c = snext();
        }
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = snext();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public String nextLine() {
        int c = snext();
        while (isSpaceChar(c))
            c = snext();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = snext();
        } while (!isEndOfLine(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null)
            return filter.isSpaceChar(c);
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private boolean isEndOfLine(int c) {
        return c == '\n' || c == '\r' || c == -1;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}
}

import java.io.*;
import java.util.*;

public class Main {
	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer buffer;

	public static void solve() {
	    long n = nl(), k = nl()-1;
	    long len = (1 << n) - 1;

	    while (k != len/2) {
            if (k > len/2) k-=(len+1)/2;
            len = len/2;
            n--;
            if (len == 1) {
                out.println(1);
                return;
            }
        }

        out.println(n);
	}

	public static void main(String[] args) throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	static String next() {
		while (buffer == null || !buffer.hasMoreElements()) {
			try {
				buffer = new StringTokenizer(in.readLine());
			} catch (IOException e) {
				//
			}
		}
		return buffer.nextToken();
	}

	static int ni() {
		return Integer.parseInt(next());
	}

	static long nl() {
		return Long.parseLong(next());
	}

	static double nd() {
		return Double.parseDouble(next());
	}

	static String ns() {
		return next();
	}

	static int[] ni(int n) {
		int[] res = new int[n];
		for (int i = 0; i < n; i++)
			res[i] = Integer.parseInt(next());
		return res;
	}

	static long[] nl(int n) {
		long[] res = new long[n];
		for (int i = 0; i < n; i++)
			res[i] = Long.parseLong(next());
		return res;
	}

	static double[] nd(int n) {
		double[] res = new double[n];
		for (int i = 0; i < n; i++)
			res[i] = Double.parseDouble(next());
		return res;
	}

	static String[] ns(int n) {
		String[] res = new String[n];
		for (int i = 0; i < n; i++)
			res[i] = next();
		return res;
	}

}

import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main {
	public static void main(String[] args) throws Exception {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskA {
		int[] dx = { 1, 0, -1, 0, -1, -1, 1, 1 }, dy = { 0, 1, 0, -1, -1, 1 - 1, 1 };
		int MAX = (int) (0);
		ArrayList[] list;
		HashMap<String, String> map;

		// GCD && LCM
		long gcd(long a, long b) {
			return b == 0 ? a : gcd(b, a % b);
		}

		long lcm(long a, long b) {
			return a * (b / gcd(a, b));
		}

		// REverse a String
		String rev(String s) {
			return new StringBuilder(s).reverse().toString();
		}

		/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SOLUTION IS RIGHT HERE^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
		boolean[] vis;
		int[] res;

		public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
			int n = in.nextInt();
			long k = in.nextLong();
			long low = 0, high = (1<<n)-1;

			while(low < high - 1){
				long mid = (low+high)/2;
				if(mid == k-1){
					out.println(n);
					break;
				}
				//out.println(low+" "+high);
				n--;
				if(k-1 > mid)
					low = mid;
				else
					high = mid;
			}
		}
	}

	// pair class
	static class pair implements Comparable<pair> {
		int first, second;

		public pair() {
			this.first = 0;
			this.second = 0;
		}

		public pair(int f, int s) {
			this.first = f;
			this.second = s;
		}

		@Override
		public int compareTo(pair one) {
			if (this.first < one.first)
				return -1;
			if (this.first > one.first)
				return 1;
			if (this.second < one.second)
				return -1;
			if (this.second > one.second)
				return 1;
			return 0;
		}

	}

	/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^`````````````````````````^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
	static class InputReader {
		private byte[] buf = new byte[8000];
		private int index;
		private int total;
		private InputStream in;
		// BufferedReader br = new BufferedReader(new
		// InputStreamReader(System.in));

		public InputReader(InputStream stream) {
			in = stream;
		}

		public int scan() {
			if (total == -1)
				throw new InputMismatchException();
			if (index >= total) {
				index = 0;
				try {
					total = in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public long scanlong() {
			long integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		private int scanInt() {
			int integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double scandouble() {
			double doubll = 0;
			int n = scan();
			int neg = 1;
			while (isWhiteSpace(n))
				n = scan();
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doubll *= 10;
					doubll += n - '0';
					n = scan();
				}
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doubll += (n - '0') * temp;
						n = scan();
					}
				}
			}
			return neg * doubll;
		}

		private float scanfloat() {
			float doubll = 0;
			int n = scan();
			int neg = 1;
			while (isWhiteSpace(n))
				n = scan();
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doubll *= 10;
					doubll += n - '0';
					n = scan();
				}
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doubll += (n - '0') * temp;
						n = scan();
					}
				}
			}
			return neg * doubll;
		}

		public String scanstring() {
			StringBuilder sb = new StringBuilder();
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			while (!isWhiteSpace(n)) {
				sb.append((char) n);
				n = scan();
			}
			return sb.toString();
		}

		public String scan_nextLine() {
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(n);
				n = scan();
			} while (!isEndOfLine(n));
			return res.toString();
		}

		public boolean isWhiteSpace(int n) {
			if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
				return true;
			return false;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
		/// Input module

		public int nextInt() {
			return scanInt();
		}

		public long nextLong() {
			return scanlong();
		}

		public double nextDouble() {
			return scandouble();
		}

		public float nextFloat() {
			return scanfloat();
		}

		public String next() {
			return scanstring();
		}

		public String nextLine() throws IOException {
			return scan_nextLine();
		}

		public int[] readintArray(int size) {
			int[] array = new int[size];
			for (int i = 0; i < size; i++) {
				array[i] = nextInt();
			}
			return array;
		}

		public Integer[] readIntegerArray(int size) {
			Integer[] array = new Integer[size];
			for (int i = 0; i < size; i++) {
				array[i] = nextInt();
			}
			return array;
		}
	}

}

import java.util.Scanner;

public class Three {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		StringBuffer sb = new StringBuffer();
		int n = in.nextInt();
		int k = in.nextInt();
		sb.append(1);

		for(int i = 1;i < n;i++){
			String str = sb.toString();
			sb.append(i+1);
			sb.append(str);
		}
		System.out.println(sb.toString().toCharArray()[k-1]);
	}
}

import java.io.IOException;
import java.util.Scanner;

public class ProblemB {
	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) throws IOException {
		long n = sc.nextInt(), k = sc.nextInt(), size = 1, middle;
		for (int i = 1; i < n; i++)
			size = size * 2 + 1;

		while (true) {
			middle = (size + 1) / 2;
			if (k == middle) {
				System.out.println(n);
				break;
			} else if (k < middle) {
				size = size / 2;
				n--;
			} else {
				k -= size / 2;
				n--;
				size = size / 2;
			}
		}
	}
}

import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static PrintWriter out;

    public static void main(String[] args) {
        MyScanner sc = new MyScanner();
        out = new PrintWriter(new BufferedOutputStream(System.out));

        int n = sc.nextInt(); // step number
        long k = sc.nextLong(); // ith digit

        if (n==0 || n==1) {
            out.println(1);
            return;
        }
        if (k % 2 == 1) {
            out.println(1);
        } else {
            long step = 2;
            long count = 3;
            while (step < (long)n) {
                count = (count * 2) + 1;
                step++;
            }

            long low = 1;
            long high = count;

            long middleVal = (long) n;
            while (low <= high) {
                //out.println("low: " + low + " high: " + high);
                long middle = (long) Math.ceil(((double)(high - low)/(double)2) + (double)low);

                //out.println(middle);
                if (k < middle) {
                    high = middle-1;
                    middleVal--;
                } else if (k > middle) {
                    low = middle;
                    middleVal--;
                } else {
                    out.println(middleVal);
                    break;
                }
            }

        }
        out.close();
    }

    public static class MyScanner {
        BufferedReader br;
        StringTokenizer st;

        public MyScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine(){
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }

}

import java.util.*;
import java.lang.*;

public class MyClass {
    public static void main(String args[]) {
        Scanner in=new Scanner(System.in);
        int n;
        long k;
        n=in.nextInt();
        k=in.nextLong();
        while(true){
            if(k==Math.pow(2,n-1)){
                System.out.print(n);
                break;
            }
            else if(k>Math.pow(2,n-1)){
                n-=1;
                k-=Math.pow(2,n);
            }
            else n-=1;
            System.out.println(n+" "+k);
        }
    }
}

import java.util.Scanner;

public class sequence {

	public static void main(String[] args) {
		//1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 5 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1
		Scanner input = new Scanner(System.in);
		long steps = input.nextLong();
		long target = input.nextLong();
		String length = Long.toBinaryString(target);
		int ans = 2;
		if(target % 2 != 0){
			System.out.println("1");
		}else if((int)(target - 6) % 4 == 0){
			System.out.println("2");
		}else{
			System.out.println(length.length());
		}

	}

}

import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.*;

public class TestClass {
	private static InputStream stream;
	private static byte[] buf = new byte[1024];
	private static int curChar;
	private static int numChars;
	private static SpaceCharFilter filter;
	private static PrintWriter pw;

	public static class Queue{
		private class node{
			int val;
			node next;
			node(int a){
				val = a;
				next = null;
			}
		}
		node head,tail;
		Queue(){
			head = null;
			tail = null;
		}
		public void EnQueue(int a){
			if(head==null){
				node p = new node(a);
				head = p;
				tail = p;
			}
			else{
				node p = new node(a);
				tail.next = p;
				tail = p;
			}
		}
		public int DeQueue(){
			int a = head.val;
			head = head.next;
			return a;
		}
		public boolean isEmpty(){
			return head==null;
		}
	}
	public static long pow(long x,long y,long m){
		if(y==0)
    		return 1;
    	long k = pow(x,y/2,m);
    	if(y%2==0)
    		return (k*k)%m;
    	else
    		return (((k*k)%m)*x)%m;
    }
	static long Inversex = 0,Inversey = 0;
	public static void InverseModulo(long a,long m){
		if(m==0){
			Inversex = 1;
			Inversey = 0;
		}
		else{
    		InverseModulo(m,a%m);
    		long temp = Inversex;
    		Inversex = Inversey;
    		Inversey = temp+ - (a/m)*Inversey;
    	}
    }
    static long mod1 = 1000000007;
    static long mod2 = 1000000009;
	public static long gcd(long a,long b){
		if(a%b==0)
			return b;
		return gcd(b,a%b);
	}
	public static boolean isPrime(long a){
		if(a==1)
			return false;
		else if(a==2||a==3)
			return true;
		for(long i=2;i<=Math.sqrt(a);i++)
			if(a%i==0)
				return false;
		return true;
	}
	public static double distance(int a,int b,int x,int y){
		return Math.sqrt(((long)(a-x)*(long)(a-x))+((long)(b-y)*(long)(b-y)));
	}
	public static class Pair implements Comparable<Pair> {
		long u;
		long v;
		BigInteger bi;
		public Pair(long u, long v) {
			this.u = u;
			this.v = v;
		}
		public int hashCode() {
			int hu = (int) (u ^ (u >>> 32));
			int hv = (int) (v ^ (v >>> 32));
			return 31 * hu + hv;
		}
		public boolean equals(Object o) {
			Pair other = (Pair) o;
			return u == other.u && v == other.v;
		}
		public int compareTo(Pair other) {
			return Long.compare(u, other.u) != 0 ? Long.compare(u, other.u) : Long.compare(v, other.v);
		}
		public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}
	}
	public static int seive(int a[],boolean b[],ArrayList c){
		int count = 0;
		for(int i=2;i*i<a.length;i++){
			if(!b[i]){
				for(int j=i*i;j<a.length;j=j+i)
					b[j] = true;
				c.add(i);
				a[count++] = i;
			}
		}
		return count;
	}
	public static void MatrixMultiplication(int a[][],int b[][],int c[][]){
		for(int i=0;i<a.length;i++){
			for(int j=0;j<b[0].length;j++){
				c[i][j] = 0;
				for(int k=0;k<b.length;k++)
					c[i][j]=(int)((c[i][j]+((a[i][k]*(long)b[k][j])%mod1))%mod1);
			}
		}
	}
	public static void Equal(int arr[][],int temp[][]){
		for(int i=0;i<arr.length;i++){
			for(int j=0;j<arr.length;j++)
				temp[i][j] = arr[i][j];
		}
	}
	private static void soln(){
		long n = nL();
		long k = nL();
		long p = (int)Math.pow(2, n-1);
		while(k%p!=0){
			p/=2;
			n--;
		}
		pw.println(n);
	}
	public static void main(String[] args) {
		InputReader(System.in);
		pw = new PrintWriter(System.out);
		soln();
		pw.close();
	}
	// To Get Input
	// Some Buffer Methods
	public static void InputReader(InputStream stream1) {
		stream = stream1;
	}
	private static boolean isWhitespace(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}
	private static boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}
	private static int read() {
		if (numChars == -1)
			throw new InputMismatchException();
		if (curChar >= numChars) {
			curChar = 0;
			try {
				numChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (numChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}
	private static int nI() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	private static long nL() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			if (c < '0' || c > '9')
				throw new InputMismatchException();
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}
	private static String nextToken() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}
	private static String nLi() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}
	private static int[] nIA(int n) {
		int[] arr = new int[n];
		for (int i = 0; i < n; i++)
			arr[i] = nI();
		return arr;
	}
	private static long[] nLA(int n) {
		long[] arr = new long[n];
		for (int i = 0; i < n; i++)
			arr[i] = nL();
		return arr;
	}
	private static void pArray(int[] arr) {
		for (int i = 0; i < arr.length; i++)
			pw.print(arr[i] + " ");
		pw.println();
		return;
	}
	private static void pArray(long[] arr) {
		for (int i = 0; i < arr.length; i++)
			pw.print(arr[i] + " ");
		pw.println();
		return;
	}
	private static boolean isSpaceChar(int c) {
		if (filter != null)
			return filter.isSpaceChar(c);
		return isWhitespace(c);
	}
	private interface SpaceCharFilter {
		public boolean isSpaceChar(int ch);
	}
}

import java.util.*;
public class ChloeAndTheSequence {
    public static void main(String args[]){
        Scanner sc= new Scanner(System.in);
        int n=sc.nextInt();
        double k=sc.nextDouble();

        if(k%2!=0)
            System.out.println(1);
        else{
            for(int i=1;i<=n;i++){
                if((int)(k/Math.pow(2, i))%2!=0){
                    System.out.println(i+1);
                    break;
                }
            }
        }
    }
}

import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Locale;
import java.util.StringTokenizer;

public class Solution743B implements Runnable {

    public static final double LOG2 = Math.log(2);
    public static final int NIL = Integer.MIN_VALUE;
    BufferedReader in;
    PrintWriter out;
    StringTokenizer tok = new StringTokenizer("");

    public static void main(String[] args) {
        new Thread(null, new Solution743B(), "", 256 * (1L << 20)).start();
    }

    public void run() {
        try {
            long t1 = System.currentTimeMillis();
            if (System.getProperty("ONLINE_JUDGE") == null
                    && Files.exists(Paths.get("input.txt"))) {
                in = new BufferedReader(new FileReader("input.txt"));
                out = new PrintWriter("output.txt");
            } else {
                in = new BufferedReader(new InputStreamReader(System.in));
                out = new PrintWriter(System.out);
            }
            Locale.setDefault(Locale.US);
            solve();
            in.close();
            out.close();
            long t2 = System.currentTimeMillis();
            System.err.println("Time = " + (t2 - t1));
        } catch (Throwable t) {
            t.printStackTrace(System.err);
            System.exit(-1);
        }
    }

    String readString() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine());
        }
        return tok.nextToken();
    }

    int readInt() throws IOException {
        return Integer.parseInt(readString());
    }

    long readLong() throws IOException {
        return Long.parseLong(readString());
    }

    double readDouble() throws IOException {
        return Double.parseDouble(readString());
    }

    // solution

    void solve() throws IOException {
        long n = readLong(),
                k = readLong();
        long mask = 0;

        for (int i = 0; i < n; i++) {
            mask <<= 1;
            mask ++;
        }
        long tail = k & mask;

        System.out.println(Long.numberOfTrailingZeros(tail));
    }
}

import java.util.Scanner;

public class sequence {

	public static void main(String[] args) {
		//1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 5 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1
		Scanner input = new Scanner(System.in);
		int steps = input.nextInt();
		long target = input.nextLong();
		int ans = 2;
		if(target % 2 != 0){
			System.out.println("1");
		}else if((target - 6) % 4 == 0){
			System.out.println("2");
		}else{
			while(target != 2){
				target = (int) target/2;
				ans++;
			}
			System.out.println(ans);
		}

	}

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B {
	public static void main(String[] args) throws IOException{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String[] ns = bf.readLine().split(" ");
		int n = Integer.parseInt(ns[0]);
		long k = Integer.parseInt(ns[1]);
		long length = 1;
		for(int i = 1;i<n;i++){
			if(k<=length){
				for(i=i;true;i--){
					if(k==(length+1)/2){
						System.out.println(i);
						return;
					}
					else{
						long diff = length-k;
						length = (length-1)/2;
						if(k>length)
							k = length-diff;
					}
				}
			}

			length = 2*length+1;
		}
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author rishus23
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        static long y;
        static int k;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.nextInt();
            k = in.nextInt();
            long x = (1 << n) - 1;
            y = x;
            int v = s(x, n);
            out.print(v);
        }

        private int s(long x, int n) {
            //System.out.println(x+" "+n+" "+((x>>1) + 1));
            long t = (x >> 1) + 1;
            while (t <= y) {
                if (t == k)
                    return n;
                t += (n << 1) - 1;
            }
            return s(x >> 1, n - 1);

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void print(int i) {
            writer.print(i);
        }

    }
}

import java.util.Scanner;

public class OneProject {
	public static void solve384A() {
		int n, a, b;
		Scanner in = new Scanner(System.in);
		n = in.nextInt(); a = in.nextInt() - 1; b = in.nextInt() - 1;
		in.nextLine();
		char[] s = new char[n];
		s = (in.nextLine()).toCharArray();
		if (s[a] == s[b]) {
			System.out.print(0);
		} else {
			System.out.print(1);
		}
	}
	public static void solve384C() {
		int n;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		if (n == 1) System.out.print(-1);
		else System.out.printf("%d %d %d", n, n + 1, n * (n + 1));
	}

//	This recursive function is too slow
//	public static void func384B(int s, int[] input, int begin, int end) {
//		if (s == 1) input[begin] = 1;
//		else {
//			int mid = begin + (end - begin) / 2;
//			input[mid] = s;
//			func384B(s - 1, input, begin, mid - 1);
//			func384B(s - 1, input, mid + 1, end);
//		}
//	}
//	public static void func384B(int s, int[] input) {
//		func384B(s, input, 0, input.length - 1);
//	}
	public static void solve384B() {
		int n, i;
		Scanner in = new Scanner(System.in);
		n = in.nextInt();
		i = in.nextInt();
		long begin = 1, end = 1;
		for (int j = 1; j != n; ++j) {
			end = end * 2 + 1;
		}
		System.out.print(end);
		while (n > 0) {
			long mid = begin + (end - begin) / 2;
			if (i == mid) {
				System.out.print(n);
				break;
			}
			else if (i < mid) {
				end = mid - 1;
				n--;
			}
			else {
				begin = mid + 1;
				n--;
			}
		}
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		solve384B();
	}
}

import java.util.*;
import java.io.*;
import java.lang.*;

public class B743 {

  public static void main(String[] args) {

    int sequence, index;
    int solutions = 1;

    Scanner s = new Scanner(System.in);

    sequence = s.nextInt();
    index = s.nextInt();

    while(index > 1){
      index = index/2;
      solutions++;
    }

    System.out.println(solutions);
  }
}

/* Scanner operations */

//Read an int from scanner
// int num = s.nextInt();
//Read a string from scanner
// String pattern1 = s.next();

/* String operations */

// Get a character from an index of a string.
// stringName.charAt(i);

// String from char array
// String.valueOf(interpretation);

// substring from index
// stringName.substring(startIndex, endIndex);

/* Char operations */

// Convert a char to an integer ascii value
// (int) charName;

import java.io.BufferedInputStream;
import java.util.Scanner;

/**
 * Created by ADMIN on 4/24/2017.
 */
public class ChloeAndTheSequence {
    static Scanner sc = new Scanner(new BufferedInputStream(System.in));

    public static void main(String[] args) {
        int n = sc.nextInt();
        long k = sc.nextLong();
        while(Long.bitCount(k)>1)
        {
            k = (1<<n) - k;
            n = 0;
            while((1<<n)<k)n++;
        }
        int i = 0;
        while ((k&(1<<i))==0)i++;
        System.out.println(i+1);
    }

}

import java.util.*;
import java.math.*;
import java.io.*;

public class Cheker{
	public static InputReader sc;
    public static PrintWriter out;
    public static final int MOD = (int) (1e9 + 7);
    public static void main(String[] args){
    	sc=new InputReader(System.in);
    	out=new PrintWriter(System.out);
    	int n=sc.nextInt();
    	int k=sc.nextInt();
    	String str="1";
    	int min=2;
    	n-=1;
    	while(n>0){
    		String temp=str;
    		str+=String.valueOf(min);
    		min+=1;
    		str+=temp;
    		n--;
    	}
    	out.println(str.charAt(k-1));
    	out.close();
    }

    static void shuffle(int[] A){
    	for(int i=A.length-1;i>0;i--){
    		int j=(int)(Math.random()*(i+1));
    		int temp=A[j];
    		A[j]=A[i];
    		A[i]=temp;
    	}
    }

	public static class Node implements Comparable<Node>{
	    int next;
	    long dist;

	    public Node (int u, int v) {
	        this.next = u;
	        this.dist = v;
	    }

	    public void print() {
	        out.println(next + " " + dist + " ");
	    }

	    public int compareTo(Node n) {
	        return Integer.compare(-this.next, -n.next);
	    }
	}

	public static BigInteger pow(BigInteger base, BigInteger exp) {
	    if(exp.equals(new BigInteger(String.valueOf(0)))){
	        return new BigInteger(String.valueOf(1));
	    }
	    if(exp.equals(new BigInteger(String.valueOf(1))))
	        return base;
	    BigInteger temp=exp.divide(new BigInteger(String.valueOf(2)));
	    BigInteger val = pow(base, temp);
	    BigInteger result = val.multiply(val);
	    result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    BigInteger AND=exp.and(new BigInteger(String.valueOf(1)));
	    if(AND.equals(new BigInteger(String.valueOf(1)))){
	        result = result.multiply(base);
	        result=result.remainder(new BigInteger(String.valueOf(MOD)));
	    }
	    return result;
	}

	static class InputReader {

	    private InputStream stream;
	    private byte[] buf = new byte[8192];
	    private int curChar, snumChars;
	    private SpaceCharFilter filter;

	    public InputReader(InputStream stream) {
	        this.stream = stream;
	    }

	    public int snext() {
	        if (snumChars == -1)
	            throw new InputMismatchException();
	        if (curChar >= snumChars) {
	            curChar = 0;
	            try {
	                snumChars = stream.read(buf);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            }
	            if (snumChars <= 0)
	                return -1;
	        }
	        return buf[curChar++];
	    }

	    public int nextInt() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        int res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public long nextLong() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        int sgn = 1;
	        if (c == '-') {
	            sgn = -1;
	            c = snext();
	        }
	        long res = 0;
	        do {
	            if (c < '0' || c > '9')
	                throw new InputMismatchException();
	            res *= 10;
	            res += c - '0';
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res * sgn;
	    }

	    public int[] nextIntArray(int n) {
	        int a[] = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public String readString() {
	        int c = snext();
	        while (isSpaceChar(c))
	            c = snext();
	        StringBuilder res = new StringBuilder();
	        do {
	            res.appendCodePoint(c);
	            c = snext();
	        } while (!isSpaceChar(c));
	        return res.toString();
	    }

	    public boolean isSpaceChar(int c) {
	        if (filter != null)
	            return filter.isSpaceChar(c);
	        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	    }

	    public interface SpaceCharFilter {
	        public boolean isSpaceChar(int ch);
	    }
	}

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), m = in.nextInt();
            String s = "1";
            int cnt = 2, l = 1;
            for (int i = 0; i < n - 1; i++) {
                String t = s.substring(0, l);
                s += String.valueOf(cnt) + t;
                cnt++;
                l = s.length();
            }
            out.println(s.charAt(m - 1));
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class B {
	public static void main(String[] args) throws IOException{
		BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
		String[] ns = bf.readLine().split(" ");
		int n = Integer.parseInt(ns[0]), k = Integer.parseInt(ns[1])-1;
		long length = 1;
		for(int i = 1;i<=n;i++){
			if(k<length){
				System.out.println(i);
				return;
			}
			length = 2*length+1;
		}
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.stream.Stream;

public class TestClass implements Runnable {

	static final double time = 1e9;
	static final int MOD = (int) 1e9 + 7;
	static final long mh = Long.MAX_VALUE;
	static final Reader in = new Reader();
	static final PrintWriter out = new PrintWriter(System.out);
	StringBuilder answer = new StringBuilder();

	public static void main(String[] args) {
		new Thread(null, new TestClass(), "persefone", 1 << 28).start();
	}

	@Override
	public void run() {
//		long start = System.nanoTime();
		solve();
		printf();
//		long elapsed = System.nanoTime() - start;
//		out.println("stamp : " + elapsed / time);
//		out.println("stamp : " + TimeUnit.SECONDS.convert(elapsed, TimeUnit.NANOSECONDS));
		close();
	}

	void solve() {
		int n = in.nextInt();
		long k = in.nextLong();
		for (int i = 1; i <= n; i++) {
			if (k % (1 << i) == 1 << i - 1) {
				printf(i);
				return;
			}
		}
	}

	public interface Hash {
		public void computeHashArray();
		public void computeModArray();

	}

	class StringHash implements Hash {
		// length of string s
		private final long MH = Long.MAX_VALUE;
		private int n;
		private char[] ch;
		private long[] hash, mod;
		StringHash(char[] ch) {
			this.ch = ch;
			n = ch.length;
			hash = new long[n + 1];
			mod = new long[n + 1];
			computeHashArray();
			computeModArray();
		}

		StringHash(String s) {
			this(s.toCharArray());
		}

		StringHash(CharSequence s) {
			this(s.toString());
		}

		@Override
		public void computeModArray() {
			mod[0] = 1;
			for (int i = 1; i <= n; i++) mod[i] = (mod[i - 1] * 53) % MH;
		}

		@Override
		public void computeHashArray() {
			for (int i = 0; i < n; i++) hash[i + 1] = (hash[i] * 53 + ch[i] - 'a') % MH;
		}

		public long getHash(int i, int j) {
			return (hash[j] - hash[i] * mod[j - i] + MH * MH) % MH;
		}

		public long getHash(String s) {
			long h = 0;
			for (int i = 0; i < s.length(); i++) h = (h * 53 + s.charAt(i) - 'a') % MH;
			return h;
		}

		public long[] getHashArray() { return hash; }
		public long[] getModArray() { return mod; }
	}

	public interface Manacher {
		public void oddPalindrome();
		public void evenPalindrome();
	}

	class Palindrome implements Manacher {
		private int n;
		private char[] ch;
		private int[] oddPal, evenPal;
		public Palindrome() {}
		public Palindrome(String s) {
			this(s.toCharArray());
		}
		public Palindrome(char[] ch) {
			this.ch = ch;
			n = ch.length;
			oddPal = new int[ch.length];
			evenPal = new int[ch.length];
			oddPalindrome();
			evenPalindrome();
		}

		@Override
		public void oddPalindrome() {
			for (int i = 0, l = 0, r = -1; i < n; i++) {
				int k = i > r ? 1 : Math.min(oddPal[r + l - i], r - i);
				while (0 <= i - k && i + k < n && ch[i - k] == ch[i + k]) k++;
				oddPal[i] = k--;
				if (i + k > r) {
					l = i - k;
					r = i + k;
				}
			}
		}
		@Override
		public void evenPalindrome() {
			for (int i = 0, l = 0, r = -1; i < n; i++) {
				int k = i > r ? 0 : Math.min(evenPal[r + l - i + 1], r - i + 1);
				while (0 <= i - k - 1 && i + k < n && ch[i - k - 1] == ch[i + k]) k++;
				evenPal[i] = k--;
				if (i + k > r) {
					l = i - k - 1;
					r = i + k;
				}
			}
		}
	}

	void printf() {
		out.print(answer);
	}

	void close() {
		out.close();
	}

	void printf(Stream<?> str) {
		str.forEach(o -> add(o, " "));
		add("\n");
	}

	void printf(Object... obj) {
		printf(false, obj);
	}

	void printfWithDescription(Object... obj) {
		printf(true, obj);
	}

	private void printf(boolean b, Object... obj) {

		if (obj.length > 1) {
			for (int i = 0; i < obj.length; i++) {
				if (b) add(obj[i].getClass().getSimpleName(), " - ");
				if (obj[i] instanceof Collection<?>) {
					printf((Collection<?>) obj[i]);
				} else if (obj[i] instanceof int[][]) {
					printf((int[][])obj[i]);
				} else if (obj[i] instanceof long[][]) {
					printf((long[][])obj[i]);
				} else if (obj[i] instanceof double[][]) {
					printf((double[][])obj[i]);
				} else printf(obj[i]);
			}
			return;
		}

		if (b) add(obj[0].getClass().getSimpleName(), " - ");
		printf(obj[0]);
	}

	void printf(Object o) {
		if (o instanceof int[])
			printf(Arrays.stream((int[]) o).boxed());
		else if (o instanceof char[])
			printf(new String((char[]) o));
		else if (o instanceof long[])
			printf(Arrays.stream((long[]) o).boxed());
		else if (o instanceof double[])
			printf(Arrays.stream((double[]) o).boxed());
		else if (o instanceof boolean[]) {
			for (boolean b : (boolean[]) o) add(b, " ");
			add("\n");
		}
		else
			add(o, "\n");
	}

	void printf(int[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(long[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(double[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(boolean[]... obj) {
		for (int i = 0; i < obj.length; i++) printf(obj[i]);
	}

	void printf(Collection<?> col) {
		printf(col.stream());
	}

	<T, K> void add(T t, K k) {
		if (t instanceof Collection<?>) {
			((Collection<?>) t).forEach(i -> add(i, " "));
		} else if (t instanceof Object[]) {
			Arrays.stream((Object[]) t).forEach(i -> add(i, " "));
		} else
			add(t);
		add(k);
	}

	<T> void add(T t) {
		answer.append(t);
	}

	@SuppressWarnings("unchecked")
	<T extends Comparable<? super T>> T min(T... t) {
		if (t.length == 0)
			return null;
		T m = t[0];
		for (int i = 1; i < t.length; i++)
			if (t[i].compareTo(m) < 0)
				m = t[i];
		return m;
	}

	@SuppressWarnings("unchecked")
	<T extends Comparable<? super T>> T max(T... t) {
		if (t.length == 0)
			return null;
		T m = t[0];
		for (int i = 1; i < t.length; i++)
			if (t[i].compareTo(m) > 0)
				m = t[i];
		return m;
	}

	int gcd(int a, int b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	long gcd(long a, long b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	// c = gcd(a, b) -> extends gcd method: ax + by = c <----> (b % a)p + q = c;
	int[] ext_gcd(int a, int b) {
		if (b == 0) return new int[] {a, 1, 0 };
		int[] vals = ext_gcd(b, a % b);
		int d = vals[0]; // gcd
	    int p = vals[2]; //
		int q = vals[1] - (a / b) * vals[2];
		return new int[] { d, p, q };
	}

	// find any solution of the equation: ax + by = c using extends gcd
	boolean find_any_solution(int a, int b, int c, int[] root) {
		int[] vals = ext_gcd(Math.abs(a), Math.abs(b));
		if (c % vals[0] != 0) return false;
		printf(vals);
		root[0] = c * vals[1] / vals[0];
		root[1] = c * vals[2] / vals[0];
		if (a < 0) root[0] *= -1;
		if (b < 0) root[1] *= -1;
		return true;
	}

	int mod(int x) { return x % MOD; }

	int mod(int x, int y) { return mod(mod(x) + mod(y)); }

	long mod(long x) { return x % MOD; }

	long mod (long x, long y) { return mod(mod(x) + mod(y)); }

	int lw(long[] f, int l, int r, long k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] >= k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	int up(long[] f, int l, int r, long k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] > k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	int lw(int[] f, int l, int r, int k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] >= k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	int up(int[] f, int l, int r, int k) {
		int R = r, m = 0;
		while (l <= r) {
			m = l + r >> 1;
		    if (m == R) return m;
		    if (f[m] > k) r = m - 1; else l = m + 1;
		}
		return l;
	}

	long calc(int base, int exponent) {
		if (exponent == 0) return 1;
		long m = calc(base, exponent >> 1);
		if (exponent % 2 == 0) return m * m % MOD;
		return base * m * m % MOD;
	}

	long power(int base, int exponent) {
		if (exponent == 0) return 1;
		long m = power(base, exponent >> 1);
		if (exponent % 2 == 0) return m * m;
		return base * m * m;
	}

	void swap(int[] a, int i, int j) {
		a[i] ^= a[j];
		a[j] ^= a[i];
		a[i] ^= a[j];
	}

	void swap(long[] a, int i, int j) {
		long tmp = a[i];
		a[i] = a[j];
		a[j] = tmp;
	}

	static class Pair<K extends Comparable<? super K>, V extends Comparable<? super V>>
			implements Comparable<Pair<K, V>> {
		private K k;
		private V v;

		Pair() {}

		Pair(K k, V v) {
			this.k = k;
			this.v = v;
		}

		K getK() { return k; }

		V getV() { return v; }

		void setK(K k) { this.k = k; }

		void setV(V v) { this.v = v; }

		void setKV(K k, V v) {
			this.k = k;
			this.v = v;
		}

		@SuppressWarnings("unchecked")
		@Override
		public boolean equals(Object o) {
			if (this == o) return true;
			if (o == null || !(o instanceof Pair)) return false;
			Pair<K, V> p = (Pair<K, V>) o;
			return k.compareTo(p.k) == 0 && v.compareTo(p.v) == 0;
		}

		@Override
		public int hashCode() {
			int hash = 31;
			hash = hash * 89 + k.hashCode();
			hash = hash * 89 + v.hashCode();
			return hash;
		}

		@Override
		public int compareTo(Pair<K, V> pair) {
			return k.compareTo(pair.k) == 0 ? v.compareTo(pair.v) : k.compareTo(pair.k);
		}

		@Override
		public Pair<K, V> clone() {
			return new Pair<K, V>(this.k, this.v);
		}

		@Override
		public String toString() {
			return String.valueOf(k).concat(" ").concat(String.valueOf(v)).concat("\n");
		}
	}

	static class Reader {
		private BufferedReader br;
		private StringTokenizer st;

		Reader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			try {
				while (st == null || !st.hasMoreTokens()) {
					st = new StringTokenizer(br.readLine());
				}
			} catch (IOException e) {
				e.printStackTrace();
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		int[] nextIntArray(int n) {
			int[] arr = new int[n];
			for (int i = 0; i < n; i++)
				arr[i] = nextInt();
			return arr;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String nextLine() {
			String s = "";
			try {
				s = br.readLine();
			} catch (IOException e) {
				e.printStackTrace();
			}
			return s;
		}
	}
}

import java.io.*;
import java.util.*;

public class Main {
	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer buffer;

	public static void solve() {
	    long n = nl(), k = nl()-1;
	    long len = (1 << n) - 1;

	    while (k != len/2) {
            if (k > len/2) k-=(len+1)/2;
            len = len/2;
            n--;
            if (len == 1) {
                out.println(1);
                return;
            }
        }

        out.println(n);
	}

	public static void main(String[] args) throws IOException {
		in = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	static String next() {
		while (buffer == null || !buffer.hasMoreElements()) {
			try {
				buffer = new StringTokenizer(in.readLine());
			} catch (IOException e) {
				//
			}
		}
		return buffer.nextToken();
	}

	static int ni() {
		return Integer.parseInt(next());
	}

	static long nl() {
		return Long.parseLong(next());
	}

	static double nd() {
		return Double.parseDouble(next());
	}

	static String ns() {
		return next();
	}

	static int[] ni(int n) {
		int[] res = new int[n];
		for (int i = 0; i < n; i++)
			res[i] = Integer.parseInt(next());
		return res;
	}

	static long[] nl(int n) {
		long[] res = new long[n];
		for (int i = 0; i < n; i++)
			res[i] = Long.parseLong(next());
		return res;
	}

	static double[] nd(int n) {
		double[] res = new double[n];
		for (int i = 0; i < n; i++)
			res[i] = Double.parseDouble(next());
		return res;
	}

	static String[] ns(int n) {
		String[] res = new String[n];
		for (int i = 0; i < n; i++)
			res[i] = next();
		return res;
	}

}

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Scanner;

public class a {
	static class Reader {
		final private int BUFFER_SIZE = 1 << 16;
		private DataInputStream din;
		private byte[] buffer;
		private int bufferPointer, bytesRead;

		public Reader() {
			din = new DataInputStream(System.in);
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public Reader(String file_name) throws IOException {
			din = new DataInputStream(new FileInputStream(file_name));
			buffer = new byte[BUFFER_SIZE];
			bufferPointer = bytesRead = 0;
		}

		public String readLine() throws IOException {
			byte[] buf = new byte[64]; // line length
			int cnt = 0, c;
			while ((c = read()) != -1) {
				if (c == '\n')
					break;
				buf[cnt++] = (byte) c;
			}
			return new String(buf, 0, cnt);
		}

		public int nextInt() throws IOException {
			int ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public long nextLong() throws IOException {
			long ret = 0;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (neg)
				return -ret;
			return ret;
		}

		public double nextDouble() throws IOException {
			double ret = 0, div = 1;
			byte c = read();
			while (c <= ' ')
				c = read();
			boolean neg = (c == '-');
			if (neg)
				c = read();
			do {
				ret = ret * 10 + c - '0';
			} while ((c = read()) >= '0' && c <= '9');
			if (c == '.') {
				while ((c = read()) >= '0' && c <= '9') {
					ret += (c - '0') / (div *= 10);
				}
			}
			if (neg)
				return -ret;
			return ret;
		}

		private void fillBuffer() throws IOException {
			bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
			if (bytesRead == -1)
				buffer[0] = -1;
		}

		private byte read() throws IOException {
			if (bufferPointer == bytesRead)
				fillBuffer();
			return buffer[bufferPointer++];
		}

		public void close() throws IOException {
			if (din == null)
				return;
			din.close();
		}
	}

	// User Defined Method start
	public static int inputInt() throws IOException {
		return sc.nextInt();
	}

	public static long inputLong() throws IOException {
		return sc.nextLong();
	}

	public static double inputDouble() throws IOException {
		return sc.nextDouble();
	}

	public static String inputString() throws IOException {
		return sc.readLine();
	}

	public static void print(String a) throws IOException {
		bw.write(a);
	}

	public static void printSp(String a) throws IOException {
		bw.write(a + " ");
	}

	public static void println(String a) throws IOException {
		bw.write(a + "\n");
	}
	// User Defined Method End

	// Helper Function - start
	private static void printArray(Integer arr[]) {
		for (int i : arr)
			System.out.print(i + " ");
		System.out.println();
	}

	private static void inputArray(int arr[]) throws IOException {
		for (int i = 0; i < arr.length; i++) {
			arr[i] = s1.nextInt();
		}
	}

	// helper Function - End

	// Defining input and output stream obj - Start
	static Reader sc = new Reader();
	static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	static Scanner s1 = new Scanner(System.in);

	public static void main(String[] args) throws Exception {
		int n = s1.nextInt();
		int k = s1.nextInt();

		int arr[] = new int[n];

		if(k%2 != 0){

			System.out.println(1);
			return;
		}

		for(int i=n-1;i>=0;i--){
			arr[i] = i+1;

		}

		System.out.println(arr[(int)(Math.log10(k)/Math.log10(2))]);
	}

}

import java.io.*;
import java.util.*;

public class Stack {
    public static void main(String[] args) throws IOException {
        BufferedReader r=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer in=new StringTokenizer(r.readLine());
        int n=Integer.parseInt(in.nextToken());
        long k=Long.parseLong(in.nextToken());

        long ns[]=new long [n+1];

        for(int i=0;i<n+1;i++){
            ns[i]=(long)Math.pow(2, i)-1;
        }
        while(true){
        int p=Arrays.binarySearch(ns, k-1);

        if (p>=0){
            System.out.println(p+1);
            break;
        }
        else{
            p=(-1*p)-1;
            k-=ns[p-1];
        }
        }
    }}

import java.util.Scanner;

public class Three {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		StringBuffer sb = new StringBuffer();
		int n = in.nextInt();
		int k = in.nextInt();
		sb.append(1);

		for(int i = 1;i < n;i++){
			String str = sb.toString();
			sb.append(i+1);
			sb.append(str);
		}
		System.out.println(sb.toString().toCharArray()[k-1]);
	}
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskB solver = new TaskB();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskB {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong();
            long k = in.nextLong();
            long res = 0;

            if (k % 2 == 1) {
                res = 1;
            } else {
                while (k > 0) {
                    int m = twoPow(k);
                    if (k == (Math.pow(2L, m))) {
                        res = m + 1;
                        break;
                    }
                    k -= Math.pow(2L, m);
                }

            }
            out.println(res);
        }

        int twoPow(long k) {
            int res = 0;
            while (Math.pow(2L, res) < k) res++;
            return res;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

    }
}

import java.util.*;

public class B743 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		Scanner scan=new Scanner(System.in);

		int n=scan.nextInt();
		long k=scan.nextLong();

		long i;
		double f;
		i=k;
		f=k;

		int c=0;

		while(i==f){
			f/=2.0;
			i/=2;
			System.out.println(i+" "+f);
			c++;
		}

	System.out.println(c);

	}

}

import java.util.*;
import java.io.*;
import java.math.*;

public class B{

	static int n; static long k,res,m;
	static int find(long m,long k){
		if (m==1) return 1;
		long mid=(m+1)/2,p=m/2; long mp=(p+1)/2;

		if (k==mid){
			return find(p,mp)+1;
		}else{
			return find(p,(k<mid)?k:(k-mid+1));
		}
	}
	static void MainMethod()throws Exception{
		n=reader.nextInt(); k=reader.nextInt();
		m=1; res=1;
		for (int i=1;i<n;i++){
			m=(m*2)+1;
			if (k<=n)break;
		}
		res=find(m,k);
		printer.println(res);
	}
	public static void main(String[] args)throws Exception{
		MainMethod();
		printer.close();
	}
	static void halt(){
		printer.close();
		System.exit(0);
	}
	static PrintWriter printer=new PrintWriter(new OutputStreamWriter(System.out));
	static class reader{
		static BufferedReader bReader=new BufferedReader(new InputStreamReader(System.in));
		static StringTokenizer token=new StringTokenizer("");
		static String readNextLine() throws Exception{
			return bReader.readLine();
		}
		static String next() throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return token.nextToken();
		}
		static int nextInt()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Integer.parseInt(token.nextToken());
		}
		static long nextLong()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Long.parseLong(token.nextToken());
		}
		static double nextDouble()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Double.parseDouble(token.nextToken());
		}
	}
	static class MyMathCompute{
		static long [][] MatrixMultiplyMatrix(long [][] A, long [][] B, long mod) throws Exception{
			int n=A.length, m=B[0].length;
			int p=A[0].length;
			int i,j,k;
			if (B.length!=p) throw new Exception("invalid matrix input");
			long [][] res=new long [n][m];
			for (i=0;i<n;i++) for (j=0;j<m;j++){
				if (A[i].length!=p) throw new Exception("invalid matrix input");
				res[i][j]=0;
				for (k=0;k<p;k++)
					res[i][j]=(res[i][j]+((A[i][k]*B[k][j])% mod))% mod;
			}
			return res;
		}
		static double [][] MatrixMultiplyMatrix(double [][] A, double [][] B ) throws Exception{
			int n=A.length, m=B[0].length;
			int p=A[0].length;
			int i,j,k;
			if (B.length!=p) throw new Exception("invalid matrix input");
			double [][] res=new double [n][m];
			for (i=0;i<n;i++) for (j=0;j<m;j++){
				if (A[i].length!=p) throw new Exception("invalid matrix input");
				res[i][j]=0;
				for (k=0;k<p;k++)
					res[i][j]=res[i][j]+(A[i][k]*B[k][j]);
			}
			return res;
		}
		static long [][] MatrixPow(long [][] A,long n, long mod) throws Exception{
			if (n==1) return A;
			long [][] res=MatrixPow(A, n/2, mod);
			res=MatrixMultiplyMatrix(res, res, mod);
			if ((n % 2) == 1) res=MatrixMultiplyMatrix(A,res, mod);
			return res;
		}
		static double [][] MatrixPow(double [][] A,long n) throws Exception{
			if (n==1) return A;
			double[][] res=MatrixPow(A, n/2);
			res=MatrixMultiplyMatrix(res, res);
			if ((n % 2) == 1) res=MatrixMultiplyMatrix(A,res);
			return res;
		}
		static long pow(long a,long n,long mod){
			a= a % mod;
			if (n==0) return 1;
			long k=pow(a,n/2,mod);
			if ((n % 2)==0) return ((k*k)%mod);
			else return (((k*k) % mod)*a) % mod;
		}
		static double pow(double a,long n){
			if (n==0) return 1;
			double k=pow(a,n/2);
			if ((n % 2)==0) return (k*k);
			else return (((k*k) )*a) ;
		}
	}
}

import java.util.Scanner;

/**
 * Created by Luis Ngo on 22/12/2016.
 */
public class P743B {
    public static void main (String[] args){
        Scanner  scanner =  new Scanner(System.in);
        int n =  scanner.nextInt();
        double k = scanner.nextDouble()-1;

        double arrayLength = Math.pow(2,n)-1;
        double temp = 0;
        int count = 0;
        double start= 0;
        double end =  arrayLength;
        if (n==1) {
            System.out.println(1);
            return;
        }
        while (k != temp){
            temp = Math.floor((start +end)/2);
            if (k < temp){
                end =  temp;
            }else if (k > temp){
                start = temp;
            }
            count++;
        }
        System.out.println(n+1-count);
    }
}

import java.util.*;
import java.io.*;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;

import static java.lang.Math.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;

public class Main {
	public static void main(String[] args) throws Exception {
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		TaskA solver = new TaskA();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskA {
		int[] dx = { 1, 0, -1, 0, -1, -1, 1, 1 }, dy = { 0, 1, 0, -1, -1, 1 - 1, 1 };
		int MAX = (int) (0);
		ArrayList[] list;
		HashMap<String, String> map;

		// GCD && LCM
		long gcd(long a, long b) {
			return b == 0 ? a : gcd(b, a % b);
		}

		long lcm(long a, long b) {
			return a * (b / gcd(a, b));
		}

		// REverse a String
		String rev(String s) {
			return new StringBuilder(s).reverse().toString();
		}

		/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SOLUTION IS RIGHT HERE^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
		boolean[] vis;
		int[] res;

		public void solve(int testNumber, InputReader in, PrintWriter out) throws IOException {
			int n = in.nextInt();
			long k = in.nextLong();
			long low = 0, high = (1<<n)-1;

			while(low < high - 1){
				long mid = (low+high)/2;
				if(mid == k-1){
					out.println(n);
					break;
				}
				out.println(low+" "+high);
				n--;
				if(k-1 > mid)
					low = mid;
				else
					high = mid;
			}
		}
	}

	// pair class
	static class pair implements Comparable<pair> {
		int first, second;

		public pair() {
			this.first = 0;
			this.second = 0;
		}

		public pair(int f, int s) {
			this.first = f;
			this.second = s;
		}

		@Override
		public int compareTo(pair one) {
			if (this.first < one.first)
				return -1;
			if (this.first > one.first)
				return 1;
			if (this.second < one.second)
				return -1;
			if (this.second > one.second)
				return 1;
			return 0;
		}

	}

	/*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^`````````````````````````^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
	static class InputReader {
		private byte[] buf = new byte[8000];
		private int index;
		private int total;
		private InputStream in;
		// BufferedReader br = new BufferedReader(new
		// InputStreamReader(System.in));

		public InputReader(InputStream stream) {
			in = stream;
		}

		public int scan() {
			if (total == -1)
				throw new InputMismatchException();
			if (index >= total) {
				index = 0;
				try {
					total = in.read(buf);
				} catch (IOException e) {
					throw new InputMismatchException();
				}
				if (total <= 0)
					return -1;
			}
			return buf[index++];
		}

		public long scanlong() {
			long integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		private int scanInt() {
			int integer = 0;
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			int neg = 1;
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n)) {
				if (n >= '0' && n <= '9') {
					integer *= 10;
					integer += n - '0';
					n = scan();
				} else
					throw new InputMismatchException();
			}
			return neg * integer;
		}

		public double scandouble() {
			double doubll = 0;
			int n = scan();
			int neg = 1;
			while (isWhiteSpace(n))
				n = scan();
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doubll *= 10;
					doubll += n - '0';
					n = scan();
				}
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doubll += (n - '0') * temp;
						n = scan();
					}
				}
			}
			return neg * doubll;
		}

		private float scanfloat() {
			float doubll = 0;
			int n = scan();
			int neg = 1;
			while (isWhiteSpace(n))
				n = scan();
			if (n == '-') {
				neg = -1;
				n = scan();
			}
			while (!isWhiteSpace(n) && n != '.') {
				if (n >= '0' && n <= '9') {
					doubll *= 10;
					doubll += n - '0';
					n = scan();
				}
			}
			if (n == '.') {
				n = scan();
				double temp = 1;
				while (!isWhiteSpace(n)) {
					if (n >= '0' && n <= '9') {
						temp /= 10;
						doubll += (n - '0') * temp;
						n = scan();
					}
				}
			}
			return neg * doubll;
		}

		public String scanstring() {
			StringBuilder sb = new StringBuilder();
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			while (!isWhiteSpace(n)) {
				sb.append((char) n);
				n = scan();
			}
			return sb.toString();
		}

		public String scan_nextLine() {
			int n = scan();
			while (isWhiteSpace(n))
				n = scan();
			StringBuilder res = new StringBuilder();
			do {
				res.appendCodePoint(n);
				n = scan();
			} while (!isEndOfLine(n));
			return res.toString();
		}

		public boolean isWhiteSpace(int n) {
			if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1)
				return true;
			return false;
		}

		private boolean isEndOfLine(int c) {
			return c == '\n' || c == '\r' || c == -1;
		}
		/// Input module

		public int nextInt() {
			return scanInt();
		}

		public long nextLong() {
			return scanlong();
		}

		public double nextDouble() {
			return scandouble();
		}

		public float nextFloat() {
			return scanfloat();
		}

		public String next() {
			return scanstring();
		}

		public String nextLine() throws IOException {
			return scan_nextLine();
		}

		public int[] readintArray(int size) {
			int[] array = new int[size];
			for (int i = 0; i < size; i++) {
				array[i] = nextInt();
			}
			return array;
		}

		public Integer[] readIntegerArray(int size) {
			Integer[] array = new Integer[size];
			for (int i = 0; i < size; i++) {
				array[i] = nextInt();
			}
			return array;
		}
	}

}