#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
using namespace std;
const int mxn = 1e5 + 10;
long long n, k, q;
long long bs(long long low, long long high, long long c, long long k) {
  long long m = (low + high) / 2;
  if (m == k - 1) {
    return c;
  }
  if (low + 1 == high) {
    return c;
  }
  if (m < k) {
    return bs(m, high, c + 1, k);
  } else {
    return bs(low, m, c + 1, k);
  }
}
void input() { cin >> n >> k; }
void solve() {
  q = 1;
  for (int i = 0; i < n; i++) {
    q *= 2;
  }
  n -= bs(0LL, (long long)(q - 1), 0LL, k);
  cout << n << endl;
}
int main() {
  ios::sync_with_stdio(false);
  input(), solve();
  return 0;
}
