#include <bits/stdc++.h>
using namespace std;
long long n, k, mid, a;
int main() {
  cin >> n >> k;
  n++;
  a = 1;
  mid = 1;
  long long ans = 0;
  bool flag = false;
  while (n) {
    if (a >= k) {
      while (true) {
        if ((a + 1) / 2 == k) {
          ans = mid;
          flag = true;
          break;
        }
        if (k > (a + 1) / 2) k = ((a + 1) / 2) - (k - (a + 1) / 2);
        a = a / 2;
        mid--;
      }
    }
    if (flag) break;
    a = 2 * a + 1;
    mid++;
    n--;
  }
  cout << ans << endl;
  return 0;
}
