#include <bits/stdc++.h>
using namespace std;
long long v[55];
int main() {
  long long a, b, k;
  cin >> a >> b;
  v[1] = 1;
  for (int i = 2; i <= a; ++i) {
    v[i] = 2 * v[i - 1] + 1;
  }
  k = a;
  while (v[a]) {
    v[a] = v[a] / 2 + 1;
    if (v[a] < b)
      b %= v[a];
    else if (v[a] == b) {
      cout << k << endl;
      return 0;
    }
    v[a]--;
    k--;
  }
  cout << k << endl;
}
